Skip to content

Instantly share code, notes, and snippets.

@egorvinogradov
Created February 5, 2023 08:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save egorvinogradov/4f9180083251a6110df54d9555c00093 to your computer and use it in GitHub Desktop.
Save egorvinogradov/4f9180083251a6110df54d9555c00093 to your computer and use it in GitHub Desktop.
javascript:(function(text){
let textarea = document.querySelector('form textarea');
let event = new Event('input', { bubbles: true });
let nativeInputValueSetter = Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype, 'value').set;
nativeInputValueSetter.call(textarea, text + '\n\n' + textarea.value);
textarea.dispatchEvent(event);
})('--- TEXT ---')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment