Edit The Code:
See Result »
Try it Yourself - ©
w3big.com
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>本教程(w3big.com)</title> <script> function displayResult(x){ alert("Cell index is: " + x.cellIndex); } </script> </head> <body> <table border="1"> <tr> <td onclick="displayResult(this)">单击显示单元格下标</td> <td onclick="displayResult(this)">单击显示单元格下标</td> </tr> </table> </body> </html>