原来input 里写 value="Enter search keywords here" onfocus="if (this.value == 'Enter search keywords here') this.value = '';" onblur="if (this.value == '') this.value = 'Enter search keywords here';"不知道在TextBox 里怎么赋值写呢?

解决方案 »

  1.   

    this.TextBox1.attribuates.add("value","Enter search keywords here");
    this.TextBox1.attribuates.add("onfocus","if (this.value == 'Enter search keywords here') this.value = '';");
    .....
      

  2.   

    <asp:TextBox text="Enter search keywords here" runat="server" ><asp:TextBox>
    后台写JS
      

  3.   

    textbox不是也有 text value属性吗