How To Clear Form Fields With JQuery
Here we consider how to Clear Form Fields by using JQuery.
Lets start with one example here.
Suppose there is are some textboxes including password and multiline textarea as shown below.


Now for clearing these form fields on Button Click using Jquery, follow these code.
$(function () {
$('.clsClearBtn').click(function () {
var form = $(this).closest('form');
form.find("input[type=text], input[type=password], textarea").val("");
return false;
})
})
Here we first find the form and then set input fields value to empty.
Thereby we can clear all textboxes including password and multiline textarea using Jquery.