<tablesummary="whenandwhereyoucanseetheband"><thead><tr><th>Date</th><th>City</th><th>Venue</th></tr></thead><tbody><tr><td>June9th</td><td>Portland,<abbrtitle="Oregon">OR</abbr></td><td>CrystalBallroom</td></tr><tr><td>June10th</td><td>Seattle,<abbrtitle="Washington">WA</abbr></td><td>CrocodileCafe</td></tr><tr><td>June12th</td><td>Sacramento,<abbrtitle="California">CA</abbr></td><td>TorchClub</td></tr><tr><td>June17th</td><td>Austin,<abbrtitle="Texas">TX</abbr></td><td>Speakeasy</td></tr></tbody></table>

functionstipeTables(){if(!document.getElementsByTagName)returnfalse;vartables=document.getElementsByTagName("table");varodd,rows;for(vari=0;i<tables.length;i++){odd=false;rows=tables[i].getElementsByTagName("tr");for(varj=0;j<rows.length;j++){if(odd==true){addClass(rows[j],"odd");//rows[j].style.backgroundColor="#ffc";就兼容了odd=false;}else{odd=true;}}}}functionhighlightRows(){if(!document.getElementsByTagName)returnfalse;varrows=document.getElementsByTagName("tr");for(vari=0;i<rows.length;i++){rows[i].oldClassName=rows[i].className;//把原来的cassName属性保存到自定义属性当中rows[i].onmouseover=function(){addClass(this,"highlight");//this.style.fontWeight="bold";}rows[i].onmouseout=function(){this.className=this.oldClassName;//this.style.fontWeight="normal";}}}addLoadEvent(stipeTables);addLoadEvent(highlightRows);