I'm creating an chrome extension, and having issue that even if I changed the element text, the submit button not enables as usual and other stuff is not processing as manual typing.
I'm trying to fire the text changed event to process the elements normal behavior of manual typing using following script;
var el2=document.getElementById("tmsg");
el2.innerText="hello world";
try{
el2.fireEvent("onchange");
}catch(error)
{
alert("err:"+error);
}
However, the text is set, but getting following error
TypeError: el2.fireEvent is not a function
I'm looking for solution with java script, without JQuery solutions, but none worked for me.
Can anyone please point me what I'm doing wrong here, or better way to do that?
question from:
https://stackoverflow.com/questions/65642231/how-to-fire-change-event-of-html-element-text-using-javascript-in-a-chrome-exte 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…