用javascript实现的激活输入框后隐藏初始内容
作者:
用javascript实现的激活输入框后隐藏初始内容
<div>
<label for="email">Email</label>
<input name="email" type="text" id="email" style="width:134px;" onfocus="if(this.value==Input your email)this.value=;"onblur="if(this.value==)this.value=Input your email;" value="Input your email" />
<label for="pwd">Password</label>
<input name="pwd" type="password" id="pwd" style="width:132px;" onfocus="if(this.value==inputpass)this.value=;"onblur="if(this.value==)this.value=inputpass;" value="inputpass" />
</div>
<label for="email">Email</label>
<input name="email" type="text" id="email" style="width:134px;" onfocus="if(this.value==Input your email)this.value=;"onblur="if(this.value==)this.value=Input your email;" value="Input your email" />
<label for="pwd">Password</label>
<input name="pwd" type="password" id="pwd" style="width:132px;" onfocus="if(this.value==inputpass)this.value=;"onblur="if(this.value==)this.value=inputpass;" value="inputpass" />
</div>