In my javascript code, I want to clear the text fields after done with the operations using onclick command. Question: Is there a predefined fuction to serve this purpose?
hastings.george.5
0
Newbie Poster
Recommended Answers
Jump to PostIf you're using JQuery, something like
$(this).closest('form').find("input[type=text], textarea").val("");
Jump to PostIf the initial values when the page is parsed are blank, you can use the .reset() method of the FORM (not the individual inputs), which should revert everything back to what the values were at page render.
If you don't have a form, or are looking for a specific input …
All 5 Replies
RudyM
ryantroop
177
Practically a Master Poster
mblan180131
0
Light Poster
2teez
43
Posting Whiz
hastings.george.5
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.