<asp:TextBox id="TextBox1" runat="server"></asp:TextBox>
<INPUT type="button" value="Button" OnClick="aa()"><script language="javascript">
function aa()
{
   Form1.document.all.item("TextBox3").Text="111";
}
</script>点击按钮没有反应 应如何写?

解决方案 »

  1.   

    这个因该是Form1.document.all.item("TextBox1").Text="111"; 求解答
      

  2.   

    用GetElementById("控件ID名");试试
      

  3.   

    document.getElementById("<%=TextBox3.ClientID%>").value="asdf";
      

  4.   

    这个TextBox是asp.net的服务器端控件,我觉得应该不行吧
    用HTML的<input id="TextBox1" type="text" />
      

  5.   

    Form1.document.all.TextBox1.value="111";
      

  6.   

    <asp:TextBox id="TextBox1" runat="server" name="TextBox1"></asp:TextBox>
    加上name属性
      

  7.   

    多谢各位 已经解决 sunjay117(sunjay117) 正解
      

  8.   

    <script language="javascript">
    function aa()
    {
       document.getElementById("TextBox1").value= "111" ;
    }
    </script>
      

  9.   

    晕,搞定,document.all('TextBox1').value='111'
    因为在客户端textbox实际上是相当于客户端控件,没有Text属性