<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>event.srcElement(IE) 和 event.target(DOM)</title> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ $('td').click(function(event){ event = event? event: window.event; //兼容浏览器获得event var obj = event.srcElement ? event.srcElement:event.target; //兼容浏览器获得触发事件的元素 if(obj.tagName.toLowerCase()=='td'){ alert("行:"+(obj.parentNode.rowIndex+1)+"列:"+(obj.cellIndex+1)); //使用parentNode属性,parentElement只支持ie } }) }) </script> </head> <body> <table width="500" border="1"> <tr> <td>11</td> <td>12</td> <td>13</td> </tr> <tr> <td>21</td> <td>22</td> <td>23</td> </tr> </table> </body> </html> 详情见:http://blog.csdn.net/lenel/archive/2007/07/25/1707520.aspx