<form id="form1" runat="server"> <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> <script id="scr1" type ="text/javascript" > function getValue() { var x = document.getElementById("TextBox1"); //alert(x.getAttribute("Text")) alert(x.) } </script>
<input id="Button1" type="button" value="button" onclick ="getValue()" /> </form>
这段代码的返回值总是 “null”,不禁要问,JavaScript可以访问服务器端控件吗?
添加回答
举报
0/150
提交
取消