read
Here’s a quick jQuery tidbit. If you ever need to select or unselect all items in a muti-select box (a <select> tag set to allow multiple selected items), here’s a jQuery selector to do it.
$("#selectBox *").attr("selected", "selected");Notice the asterisk after the ID selector? That tells jQuery to get ALL child elements of the select box. We then set the selected attribute to selected, and suddenly all the items are highlighted! To unselect them all you would do the opposite.
$("#selectBox *").attr("selected", "");Setting the attribute selected to blank unselects them all. Man I love jQuery!!
Happy coding!