We Recommend

Pro JavaScript Techniques Pro JavaScript Techniques
Pro JavaScript Techniques is the ultimate JavaScript book for the modern web developer. It provides everything you need to know about modern JavaScript, and shows what JavaScript can do for your web sites. This book doesn't waste any time looking at things you already know, like basic syntax and structures.


Ballyhoo


Posted By

masaya on 07/18/06


Tagged

css javascript hightlight


Versions (?)


Who likes this?

7 people have marked this snippet as a favorite

mate
fatihturan
nutella
visualAesthetic
basicmagic
shachi
SpinZ


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.