Using jQuery you can clear form fields. Here I am going to describe, how we can clear all of the fields except a few using jQuery.
<div id="mainDiv"> <input type="text" id="txt1" /><br/> <input type="text" id="txt2" /><br/> <input type="text" id="txt3" /><br/> <input type="text" id="txt4" /><br/> <button id="clearall">Clear All</button> </div>
Now, we can get this using a jQuery like below:
$('#clearall').click(function(){
$('#mainDiv > input:text').val('');
}); Modern web applications rarely live alone. A customer portal, an internal order-management console, or a…
An invoice lands in the accounts inbox for equipment delivered three weeks ago. The supplier…
A Google Ads management campaign can look healthy in the dashboard and still waste money…
A potential customer arrives on your website after searching for a service you provide. They…
In the business world, there’s no such thing as a new idea. The best we…
Both of these work. Both are difficult. And anyone telling you one is obviously better…