JavaScript & CSS help

  • Thread starter Thread starter Zom
  • Start date Start date

Zom

Zom

Associate
Joined
18 Oct 2002
Posts
1,117
I would like the color of the list marker to alternate each time it is clicked. It starts off grey, then I want it turn blue on the next click and then back to grey and so on. However, I'm not sure how to do this in JavaScript - can anyone help? This is what I have so far:
CSS
Code:
li.grey {list-style-type: square; color: grey;}
HTML
Code:
<li id="CornflowerBlue" class="grey" onClick="this.style.color=this.id;"><a href="#">Link1</a></li>
Thanks in Advance
 
Back
Top Bottom