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?
Like how the click() can be used to trigger a click event on an
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Are you looking for a way to trigger the events associated with typing or do you want to append text to a container so that it looks like someone is typing? If you’re looking for the events, then @Nick is absolutely correct in suggesting the methods for triggering the event. If the latter, you’ll want to use a timer to replace the text/html of the container with successive substrings of your text. You might be able to get a better effect by appending successive
spanelements containing each letter if the text is very long — this would reduce flashing as the text gets replaced and the layout changes momentarily.EDIT: I was going to add an example, but it turns out there’s a plugin for that already: jTypeWriter.