Last active
October 11, 2016 12:27
-
-
Save Prithvirajbilla/50dc499242c32cbf81f4 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| function dispatch(target, eventType, char) { | |
| var evt = document.createEvent("TextEvent"); | |
| evt.initTextEvent (eventType, true, true, window, char, 0, "en-US"); | |
| target.focus(); | |
| target.dispatchEvent(evt); | |
| } | |
| dispatch(document.querySelector(".block-compose .input"), "textInput", "hello!"); | |
| function triggerClick() { | |
| var event = new MouseEvent('click', { | |
| 'view': window, | |
| 'bubbles': true, | |
| 'cancelable': true | |
| }); | |
| document.querySelector(".icon.btn-icon.icon-send").dispatchEvent(event) | |
| } | |
| triggerClick() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
didn't work here