<td onclick="alert(this.offsetHeight);">

解决方案 »

  1.   

    <tr  onclick="alert(this.offsetHeight)">
      

  2.   

    function hehe()
    {
    alert(event.srcElement.offsetHeight);
    }<TABLE id=oTable border=1 onclick="hehe();">这样做的好处是一次写onclick就对整个表格,甚至后来动态增加的单元格生效。
      

  3.   

    请问offsetHeight和clientHeight有什么区别
      

  4.   

    <script>
    document.onclick=function() {
      var target = event.srcElement;
      if (target.tagName="TD") {
        alert(target.offsetWidth);
        event.cancelBubble = true;
        event.returnValue = false;
      }
    }
    </script>
      

  5.   

    clientHeight Property  Retrieves the height of the object including padding, but not including margin, border, or scroll baroffsetHeight Property  Retrieves the height of the object relative to the layout or coordinate parent, as specified by the offsetParent property.
      

  6.   

    其实事件代码可以写在单元格的任何一个层次的容器上。我也是不久前才学来的。反正有事件冒泡。
    tony抄袭!!!    开个玩笑,吹牛的方式与我相同。