还有另外一个疑问,parseInt(document.getElementById("<%=Button1.ClientID %>").style.top);这样不是获取他的坐标吗,为什么不行

解决方案 »

  1.   

    服务器端控件 label没有.value属性。主要看服务器端控件生成的HTML代码!
    <input></input> 标签 所谓的表单元素才有.value属性。其他的你要获取里面的内容可以用
    document.getElementById("<%=Button1.ClientID %>").innerHTML/document.getElementById("<%=Button1.ClientID %>").innerText。
      

  2.   

    好好去看看Javascript的一些语法吧,下载一个 Javascript参考手册
      

  3.   

    好的,谢谢了,还有一个问题请回答一下,立刻给分.
    parseInt(document.getElementById("<%=Button1.ClientID %>").style.top);这样不是获取他的坐标吗,为什么不行
      

  4.   

    这个可能和positon 有关。你可以先alert(document.getElementById("<%=Button1.ClientID %>").style.top)看看效果