How to get the selected item from UL using jQuery?

Posted by Vibin Jith on Stack Overflow See other posts from Stack Overflow or by Vibin Jith
Published on 2010-03-20T12:46:30Z Indexed on 2010/03/20 12:51 UTC
Read the original article Hit count: 202

Filed under:

I am creating a tab control using Ul and Divs. Ul is used to display the tab heads. When the user selects one Tab (ie , 'Li') ,the tab back color get changed with respect to others.

I want to get the Selected and not selected li in that Ul .

I used

 $(".tab li:selected").css("background-color","red");
 $(".tab li:deselected").css("background-color","white");

It 's not working, I know the code does not work .just guess it. Now may you understood my problem,right?

© Stack Overflow or respective owner

Related posts about jQuery