

I couldn’t find an easy way to clear a text input field. This tutorial will show you a simple JavaScript line of code that can clear the fields for you.
I was working on a project where I had two text fields. The learner would enter the information and then click a Submit button. After the feedback, I wanted to have the learner put in some new information in the same text fields. However, there was no easy way to clear the text fields. So I found a simple JavaScript routine that accesses the JQuery library that will not only clear the text field but also set the focus on one of the text fields. I hope this short tutorial will be helpful to you.
I was working on a project where I had two text fields. The learner would enter the information and then click a Submit button. After the feedback, I wanted to have the learner put in some new information in the same text fields. However, there was no easy way to clear the text fields. So I found a simple JavaScript routine that accesses the JQuery library that will not only clear the text field but also set the focus on one of the text fields. I hope this short tutorial will be helpful to you.
You must be logged in to post a comment.

- Most Recent
- Most Relevant
…
Hello Phil !…
I already had this line of code in my “Javascriptionnary” !… So I assume it has been shared already by the Community !…
Thanks for the “focus” one, which is new !…
But I’m wondering how did you put your analog clock in the first frame… Was it made with Animate ?…
Glad to see you here back anyway !
😉
…