You might need to simplify, but you can't just change the .val() (value) of the input field to simulate auto-written values ?
You can just set a value like this -
$("#example").val('Some auto-written value');
You could do something more visual like this -
var autoText = ['f','o','o','b','a','r']; var characterIndex = 0; var autoType = setInterval(function(){ $("#example").val( $("#example").val() + autoText[characterIndex] ); characterIndex++; if (characterIndex >= autoText.length){ clearInterval(autoType); } },_keystroke_interval);
_keystroke_interval is the interval (in milliseconds) between automatically entered characters. The autoType interval variable will autoType over all the indices of the autoText array, and for each iteration it will add one character to the input field.
This will give you more sense of automatic printing ...
here's a working jsFiddle example
source share