Possible Duplicate:
Quick way to clear all selections on a multiselect enabled <select> with jQuery?
Dear All.
I have a problem. once i have a multiselect box and i want to clear all the contents of that when i clickon the reset button.
could you please provide me jquery for that?
Thanks.
Satya
In the future, you should post what you’ve tried so far – It gives people trying to answer your question a little more insight into what path you’re taking, and where you might be going down the wrong path.
That being said, you can remove a list item from it’s container with the
.remove()method, like this:you can see it in action here: http://jsfiddle.net/y9pzS/
and here’s a version that uses the
.empty()method to remove all of child items in the list: http://jsfiddle.net/y9pzS/1/Note: there’s a fair amount of ambiguity in your question. Not sure if you’re looking to clear out the entire container, or just remove the selected items. This will remove all items from the select box.