表格的便捷操作:tBodies, tHead, tFoot, rows, cells;
1 <!DOCTYPE html> 2 <html> 3 <head lang="en"> 4 <meta charset="UTF-8"> 5 <title></title> 6 <script> 7 window.onload = function () { 8 var oTab = document.getElementById("table1"); 9 alert(oTab.tBodies[0].rows[1].cells[1].innerHTML); 10 } 11 </script> 12 </head> 13 <body> 14 <table id="table1" border="1" width="500"> 15 <thead> 16 <td>ID</td> 17 <td>Name</td> 18 <td>age</td> 19 </thead> 20 <tbody> 21 <tr> 22 <td>1</td> 23 <td>Blue</td> 24 <td>27</td> 25 </tr> 26 <tr> 27 <td>2</td> 28 <td>张三</td> 29 <td>23</td> 30 </tr> 31 <tr> 32 <td>3</td> 33 <td>李四</td> 34 <td>28</td> 35 </tr> 36 <tr> 37 <td>4</td> 38 <td>王五</td> 39 <td>25</td> 40 </tr> 41 <tr> 42 <td>5</td> 43 <td>张伟</td> 44 <td>24</td> 45 </tr> 46 </tbody> 47 </table> 48 49 </body> 50 </html>