![]()
显示点击处为几行几列代码
![]() " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd <html xmlns=" http://www.w3.org/1999/xhtml <head> <title>event.srcElement Demo2</title> <script type="text/javascript"> // 显示点击处为几行几列 function tdclick(){ if(event.srcElement.tagName.toLowerCase()=='td') alert("行:"+(event.srcElement.parentNode.rowIndex+1)+"列:"+(event.srcElement.cellIndex+1)); } </script> </head> <body> <table align="center" width="100%" height="400" cellspacing="1" border="1" bordercolor="#000000" bordercolorlight="#000000" bordercolordark="#C0C0C0" bgcolor="#C0C0C0"> <tr> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> </tr> </table> </body> </html> ![]() |
显示点击处为几行几列代码
最新推荐文章于 2019-01-25 20:03:48 发布