使用img的style.width,style.height的属性可以达到你的要求

解决方案 »

  1.   

    如何取到img所在td的长,宽?
      

  2.   

    <IMG id="bt" name="bt" height="210" src="../a.aspx" width="100%">
      

  3.   

    <IMG id="bt" name="bt" height="210" src="../a.aspx" width="100%" height="100%">
      

  4.   

    同意楼上的,不过你把height="210"去掉更好!
      

  5.   

    src="../a.aspx" width="100%" height="100%"
      

  6.   

    可以,上面的问题已经解决了。
    可是我想通过下面的javascript获取这个图像的高度和宽度,为什么总是不行呢?
    <script language="javascript">
    var width = bt.width;
    var height = bt.height;
    alert(width);
    alert(height);
    </script>
      

  7.   

    var width = document.all("bt").width;
    var height = document.all("bt").height;
      

  8.   

    document.getElementById("bt").width
    document.getElementById("bt").height
      

  9.   

    <IMG id="bt" name="bt" height="210" src="../a.aspx" width="435" onload="alert(this.width)">