Created
October 21, 2009 19:08
-
-
Save EnigmaCurry/215354 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function alternate(id){ | |
if(document.getElementsByTagName){ | |
var table = document.getElementById(id); | |
var rows = table.getElementsByTagName("tr"); | |
for(i = 0; i < rows.length; i++){ | |
if(i % 2 == 0){ | |
rows[i].className = "even"; | |
}else{ | |
rows[i].className = "odd"; | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment