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?
In IE versions >= 9 and all other browsers you should use the dispatchEvent method:
dispatchEvent
var event = document.createEvent("HTMLEvents"); event.initEvent("change",true,false); document.getElementById("id").dispatchEvent(event);
Check out http://jsfiddle.net/QKsvv/
1.4m articles
1.4m replys
5 comments
57.0k users