0
<td class="style4">
<input type="text" ID="txtFirstName" runat="server" maxlength="50"
class="DefaultTextbox" style="width:180px;" value="First Name"
onfocus="if(this.value=='First Name') {this.value = '';document.getElementById('spanFirstName').visible=false;}"
onblur="if(this.value=='') this.value = 'First Name'"
/>
</td>
<td>
<span id="spanFirstName">Should be less than 50 characters.</span>
</td>
我想要做这样的事情此代码是否可用?使用Javascript/asp.net(代码不工作)
onfocus = "if(this.value=='First Name')
{
this.value = '';
document.getElementById('spanFirstName').visible=false;
}"
onblur = "if(this.value=='') this.value = 'First Name'"
什么是你跟你报告的代码得到的结果? – kiamlaluno 2009-12-23 12:00:05