Like how the click()
can be used to trigger a click event on an element, is there any way to simulate the typing of a string?
If you really want to simulate typing (i.e. including triggering the events and appending the text to an input or textarea element), you can use the jQuery simulate extended plugin:
http://j-ulrich.github.com/jquery-simulate-ext
Then you can use
$('input').simulate("key-sequence", {sequence: "This is a test", delay: 10});
to simulate the typing of the text "This is a test"
with a 10ms delay between each key press.
Disclaimer: I'm the author of the plugin.