I have a search field, and I need a clear button.
I currently have the button, but I don’t know how to do it,
I have 6 textfields, 2 comboboxes, and 2 multiple select lists
How do I clear all of them in one clear function??
I know the HTML way, but I am using Grails and the type=”reset” does not work.
That’s why I want a jQuery way of deleting textboxes’ values, leaving the combobox in the first index, and clear all options from the multiple select list.
Thanks for the help 😀
You can modify the code below to suit your needs. It’s stolen from this thread anyway.
jsfiddle
EDIT (To clear multiple select):
jsfiddle v2