I have attached an event to a text box using addEventListener
. It works fine. My problem arose when I wanted to trigger the event programmatically from another
Use jquery event call. Write the below line where you want to trigger onChange of any element.
$("#element_id").change();
element_id is the ID of the element whose onChange you want to trigger.
Avoid the use of
element.fireEvent("onchange");
Because it has very less support. Refer this document for its support.