I have a dblclick listener that adds values into an html input field. I also have an on change function that is supposed to enable a submit button when the value in that html input field changes. However, sblclicking, and therefore adding a value into the input field, does not enable the submit button. The button does become enabled if I click in the input field and edit the value by hand, though.
Is there a work around so that the dblclick listener can also trigger the on change function?
document.addEventListener("dblclick", function(){
document.getElementById("name").value = "Hello World!";
});
document.getElementById("name").onchange = function() {
document.getElementById("send").disabled = false;
}
<input id="name" type="text">
<input type="submit" id="send" value="Submit" disabled>