Could someone help me out with this JQuery?
I have a bunch of list items, and when clicking one of them, I want to remove the class attribute 'selected' from each list item in the same UL.
I have a javascript function:
<script type='text/javascript'>
function clearSelectedCSS(item) {
$(item).parent().$('li.itemselected').removeClass('itemselected');
}
</script>
It is called via the onclick part of each LI, and 'this' is passed.
I can't quite figure out the JQuery, could someone give me a pointer? My code basically wants to select the item that was clicked, get its parent, then select all list items that belong to that parent (ie, every li in the list that was clicked that has class 'itemselected'), then remove the class 'itemselected' from them all.