Posted By

masaya on 07/18/06


Tagged

css javascript hightlight


Versions (?)

Who likes this?

8 people have marked this snippet as a favorite

mate
fatihturan
nutella
visualAesthetic
basicmagic
shachi
SpinZ
seanpowell


Background Hight Light


 / Published in: JavaScript
 

  1. setHighLight = function(){
  2. var _div = document.getElementsByTagName("div");
  3. for (var i=0; i<_div.length; i++) {
  4. if(_div[i].className == "HightLight") {
  5. var _li = _div[i].getElementsByTagName("li");
  6. for(var j=0; j<_li.length; j++) {
  7. _li[j].style.background = (j%2) ? "#fff" : "#f2f2f2";
  8. }
  9. }
  10. }
  11. }

Report this snippet  

You need to login to post a comment.