December 10, 2005development
What I wanted:
1. alternating list item background colors
2. ability to specify which container i wanted to apply this method to (in this case a div).
So, here it is ...
setListItemAltColor(src), whereas src is the container you wish to apply this to. In the example above, the div I want to apply this to is 'test2'.
if ( i%2 == 0) -- checks to see if integer i is odd or even
divWithLists.getElementsByTagName('tag') returns a collection of all elements with the specified tag -- in this instance it's all 'li' tags.