I want to write some text in an input tag only by triggering keyboard events by programming.
I don't want to using something like
elem.value = 'some random text'
I really need to simulate keyboard to write code in this input tag. pure Javascript is my goal, but if there is a good jQuery way, I will appreciate that too!
not sure if you're looking for the infinite monkey?
function randChar() { //generate a random character - all lower case for simplicity
var chars = " abcdefghijklmnopqurstuvwxyz";
return chars.substr(Math.floor(Math.random() * 27), 1);
}
(not my code)