Created
May 4, 2014 21:28
-
-
Save gabrielschulhof/c50cd5b0cc5bcad9d224 to your computer and use it in GitHub Desktop.
trigger native change event
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ("createEvent" in document) { | |
var evt = document.createEvent("HTMLEvents"); | |
evt.initEvent("change", false, true); | |
element.dispatchEvent(evt); | |
} | |
else { | |
element.fireEvent("onchange"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment