Created
February 23, 2018 04:34
-
-
Save akirattii/26eec20ba2329f1202052e3fdbe20aa2 to your computer and use it in GitHub Desktop.
Pure js event trigger
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
const el = document.qeurySelector("#input-x"); | |
// Fire `input` event: | |
el.dispatchEvent(new Event('input', { | |
'bubbles': true, | |
'cancelable': true | |
})); | |
// or | |
el.dispatchEvent(new CustomEvent('input', { | |
'bubbles': true, | |
'cancelable': true | |
})); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment