Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
var text = $('.nonHideableWords').textContent.split(' '),
input = $('input');
function triggerKeyboardEvent(el, keyCode)
var eventObj = document.createEventObject ?
document.createEventObject() : document.createEvent("Events");
eventObj.initEvent("keydown", true, true);
eventObj.keyCode = keyCode;
eventObj.which = keyCode;
el.dispatchEvent ? el.dispatchEvent(eventObj) : el.fireEvent("onkeydown", eventObj);
for(var i=0; i<text.length; i++){
var character = text[i];
input.value = character;
triggerKeyboardEvent(input, 32)

This comment has been minimized.

Copy link

@24carbon 24carbon commented Mar 15, 2018

mine is not working what do you do?


This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.