How to .reset() form with jQuery

Such jQuery call won’t work:

	// error: $("#formId").reset() is not a function

As the tutorial shows (yes, I never read manuals before I get into troubles as well, but always google answers before think, lol), we can have the following:

function resetForm(id) {

…and somewhere on a page this:

	<input type="button" onclick="resetForm('formId');" />

This entry was posted on Saturday, November 22nd, 2008 at 04:56 and is filed under jQuery. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

45 Responses to “How to .reset() form with jQuery”

Wha-ha! Just use



Thanks Konstantin, easy solution

this doesnt work..
someone please help…

add this at the end of the form

and try this,

add this at the end of the form
<div style=”display=’none’” ><input type=”reset” id=”rst_form”></div>

and try this,



easy solution but it work!!!

Bruno Soares

only this:


get the form element…. and not the specific form directly: (‘#myform’)

it work => $(‘#myform’)[0].reset()
Thanks for the idea

Thanks a lot for a good idea.

well, it would better is everybody use all-around jQuery style, what means that correct solution is


My shot:
$(resetSelector).bind(‘click’, function (event) {
if(confirm(“Reset form?”)) {

just place somewhere in form button will be invisible and not clicable but:
anywhere in you scrip you can use: $(“my-reset-button”),click()
I’m tested it today – it works !

brgds, Marek

It wasn’t working for me until i moved the reset command from after a .prepend to before it. I guess don’t change any of the page content before attempting the form reset.

Is not workink for me, what does it mean $(”my-reset-button”)?

Good article but I agree with Konstantin, you don’t need to create a function just to do this. Also, you should look into custom jQuery functions rather than using vanilla javascript for this. Just a thought.

Doctors have treated a few of these babies with Viagra and observed vast improvements in their ability to get oxygen-rich blood from the lungs to other parts of the body. viagra

the function with dollar sign returns a jQuery object and not the dom element itself. The solution is mentioned above in other comments but i’d like to introduce a jQuery function “get” which returns the dom element itself;


@prabhakaran: Thanks! Great solution! :)

[...] From: May 7, 2012 | Posted in: JS | Tags: jQuery | No Comments » [...]

Tai Nguyen

Sheesh, youngsters nowadays. It’s like they’ve completely forgotten that jQuery is a framework on top of Javascript. Does anyone even know Javascript anymore? Apparently not.

Let me explain exactly what happens when you run $(“#myform”)[0].reset();

1) jQuery will get the DOM element based on the ID you gave it.
2) It wraps that DOM element in a jQuery object with a bunch of other junk
3) It then returns a jQuery object with the DOM element in the zero index position.
4) When you request the zero-index array, you receive the DOM element back again.
5) You run the reset() method which is a native Javascript method that only works on DOM elements.

Oh and by the way, jQuery has to execute about 50 lines of code and do a bunch of extra crap just to return that jQuery object. And what does it use to get that original DOM element? Plain old Javascript: elem = document.getElementById( match[2] )

So can you see how insanely stupid it is to ask jQuery to run through all that garbage when all you had to do in the first place was:


Thank you for that enlightening writeup. If any reader needs to visit a proficient NYC Doctor, contact our clinic by calling us through our contact number 212-740-4600. We are affectionate in keeping our patients free from harm and healthy all throughout the year.

Wow. The .each() method is kinda overkill if you’re just targeting one element.
I’ve wrote a small blog post about the topic myself including examples of the most common pitfalls when trying to reset a jQuery form and the shortest code possible to reset a form. It can be found here:

nhat quan


Desert Fox

Try this


thanks you :)

Working out the root problem from which the root was taken.
Sarah Friar – Goldman Sachs. Approach it the same way as right wingers want to regulate a variety
of industries, we are looking for a system that relies on biomass for energy is greatly decreased.
En esos casos, el prezzo viagra relaja al joven y permite que deje sus temores a
un lado, explica el psic?

This is certainly attention-grabbing, You are a quite specialist blog writer. I’ve joined your current rss feed and look ahead of time to help in search of additional within your fantastic post. Furthermore, I’ve got shared your blog inside my social support systems

Hi my family member! I want to say that this post is awesome,
great written and come with approximately all vital infos.
I’d like to look more posts like this .

Thank you, I’ve just been searching for information approximately this subject for a while and yours is the greatest I have found out so far. However, what about the bottom line? Are you positive in regards to the source?|What i do not understood is in fact how you’re now not really a lot more neatly-liked than you might be right now. You’re very intelligent.

Great blog right here! Also your website rather a lot up very fast! What host are you the use of? Can I am getting your associate hyperlink on your host? I want my web site loaded up as quickly as yours lol

I enjoy the beneficial details people source to your articles. Let me book mark your blog post along with have a look at once again in this article often. I am just quite sure I will learn a lot of completely new information right here! Best of luck for the next!

Excellent items from you, man. I have consider your stuff prior to and you’re just extremely excellent. I really like what you’ve acquired right here, certainly like what you are saying and the best way wherein you say it. You are making it enjoyable and you continue to take care of to keep it wise. I can not wait to read far more from you. This is actually a tremendous site.

Amazon aims to focus on customer experience through offering
a wide array of products at low prices at the most convenient possible way.
Word of mouth programmes capture, interpret and measure a huge range of unprompted online conversations about a brand.
Marketing majors, and others entering the advertising industry, generally work in one of
two areas of advertising: sales or creative.

My weblog – online marketing and advertising tools

My pal advisable I’d personally like that web-site. He or she has been entirely appropriate. This particular publish really designed my working day.. Affiliate Site You can not consider only exactly how so much time period I had put together put in due to this information! Thanks a lot!

If you want to place a bid yourself, its exposed to has.

Purely submit the Contact Form regarding the website.

Feel free to surf to my blog :: business intelligence

I read a lot of interesting posts here. Probably you spend
a lot of time writing, i know how to save you a lot of time, there is an online tool that creates readable,
google friendly articles in seconds, just search in google – laranitas free content source

Good day! I know this is kinda off topic but I was wondering if you
knew where I could find a captcha plugin for my comment form?

I’m using the same blog platform as yours and I’m having trouble finding
one? Thanks a lot!

Thank you for the excellent writeup.. medicare maryland The idea in truth was a leisure bill them. View sophisticated so that you can considerably additional reasonable within you! Incidentally, exactly how should we communicate?

awesome cool usb gadgets toys…

simple » Blog Archive » How to .reset() form with jQuery…


simple » Blog Archive » How to .reset() form with jQuery…

Used Bikes In Delhi…

simple » Blog Archive » How to .reset() form with jQuery…

Best Google Tech Support Technician for Google Product issues toll free +1-877-249-8558
Google is the biggest online company having its digital presence.
There are millions of people using various services
of Google like email, drive, drop box, hangout, and many other services.

Based out in United States, Google has most of its services as free while some advanced services are available as paid service.

Leave a Reply


required (will not be published)