ChatGPT Continue Button

Makes the send button type continue and submit it if there is nothing in the textarea

< Opinie na ChatGPT Continue Button

Pytanie/komentarz

§
Napisano: 10-06-2023

//----------------------NEW CODE-------------------
//WRITTEN BY CHATGPT AFTER ANALYZING THE SOURCE CODE

(function() {
'use strict';

// Find the textarea element
const textarea = document.querySelector('textarea');

// Create the 'continue' button
const continueButton = document.createElement('button');
continueButton.textContent = 'Continue';
continueButton.style.marginLeft = '10px';

// Add an event listener to the 'continue' button
continueButton.addEventListener('click', function() {
// Type "Continue" in the textarea
textarea.value = 'Continue';

// Trigger the input event to make the textarea send the message
const inputEvent = new Event('input', { bubbles: true });
textarea.dispatchEvent(inputEvent);
});

// Insert the 'continue' button next to the textarea
textarea.parentNode.insertBefore(continueButton, textarea.nextSibling);
})();

Odpowiedz

Zaloguj się, by odpowiedzieć.