编辑下面的代码:【加编码】
<html> <head> <script> function displayResult(x) { alert("Cell index is: " + x.cellIndex); } </script> </head> <body> <table border="1"> <tr> <td onclick="displayResult(this)">Click to show cellIndex</td> <td onclick="displayResult(this)">Click to show cellIndex</td> </tr> </table> </body> </html>
结果: 【此窗口】 帮助?
Try it Yourself - © 自强学堂