Searched around the place yet I still couldn't find a solution that I matched my situation. So I decided to ask it myself. Here's what I want to do:
- If one of the
<li>is clicked, that particular<li>will be given a new class named "bla" and any other<li>will lose "bla" class. - If a
<li>which already has "bla" class is clicked, it will lose the "bla" class. - if ANYTHING else on the page outside the
<ul>is clicked, "bla" class will be removed from all the<li>.
The HTML:
<ul>
<li>Item One</li>
<li>Item Two</li>
<li>Item Three</li>
<li>Item Four</li>
</ul>
Thank you...