I have an div element
<div id=form><form id="formstuff">form input stuff</div></div>
that shows/hides (or toggles) when users clicks on another element
<div id="close"></div>
If #form is shown and user decides to input values, but suddenly decides to just click on the #close button to close the #form element without deleting the values. How would you delete all input values when the user decides to close #form or hide()?
Is the only way to do something like $(this).val(''); Or is there something like .empty(); but I don’t want to remove style and such, just the text.
Try this: http://jsfiddle.net/96FJp/
UI:
jQuery:
To include other inputs, just put a comma on jQuery selector, do this: http://jsfiddle.net/dpRJy/1/
UI:
jQuery: