Rather frustrating time here with IE9. This code works in IE7/8, but not 9.
document.getElementById('id').fireEvent("OnChange");
Any insight as to why?
Fire event means a response by the Des Moines Fire Department to extinguish a fire within a building, dwelling or other structure that commences with the dispatching of fire department resources and concludes with the fire officer in charge terminating the incident.
Browser support: Initializes an event object and dispatches it to the current element. To create an event object, use the createEventObject method in Internet Explorer. The created event can be passed as a second parameter of the fireEvent method.
In IE versions >= 9 and all other browsers you should use the dispatchEvent
method:
var event = document.createEvent("HTMLEvents");
event.initEvent("change",true,false);
document.getElementById("id").dispatchEvent(event);
Check out http://jsfiddle.net/QKsvv/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With