Highlighting alternate table rows

NumberNameThingy
1ItemItem
2ItemItem
3ItemItem
4ItemItem
5ItemItem
6ItemItem

Code

function tableRows() {
 if (document.getElementsByTagName) {
  var tables = document.getElementsByTagName('table');
  for (var i = 0; i < tables.length; i++) {
   var trs = tables[i].getElementsByTagName('tr');
   for (var j = 1; j < trs.length; j+=2) {
    trs[j].className = 'alternate';
   }
  }
 }
}

Home - More stuff