<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可以訪問服務器端控件嗎?
JavaScript可以訪問服務器端控件嗎?
HUWWW
2018-12-06 13:00:19