I have a textarea with text and my button submit not working while I didn't put smth in textarea, I have text in textarea, but I didn't press smth in this textarea and I want to imitate onchange
let el = document.getElementsByTagName('textarea');
how to do it? that what i did, but it's not working
const event = new MouseEvent('change', {
bubbles: true,
cancelable: true,
});
debugger
el.dispatchEvent(event);
I have a mistake on dispatchEvent - Property 'dispatchEvent' does not exist on type 'HTMLCollectionOf'. And I think this is wrong way