(As I have issues with mozilla, I have to empty FORM after submission.)
At submit I need to empty FORM values. Is there a neater and simpler way of doing this?
$('#name').val(''); // empty form input
$('#comment').val(''); // empty form textarea
$('#email').val(''); // empty form input
something as: (wrong)
$('#name','#comment','#email').val('');
The plain form
.reset()help method is there for you. Since this method is a native “DOM” method fromHTMLInputElementyou need to grab theDOMNodefrom the jQuery object. That can be accomplished by invoking.get(0)help (which grabs the first element from the jQuery array-like-object) or just access it with brackets.demo: http://www.jsfiddle.net/53SRZ/
Another option is to use a selector like
If you don’t have the requirement to only clear specific elements.