onFocus事件就是当光标落在文本框中时发生的事件。
onBlur事件是光标失去焦点时发生的事件。
<form action="/chat" method="get">
<li>
<input type="text" name="loginName" class="text" value="Username" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Username';}" ></input><a href="#" class=" icon user"></a>
</li>
<li>
<input type="password" name="loginPassword" value="Password" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Password';}"></input><a href="#" class=" icon lock"></a>
</li>
<div class="p-container">
<label class="checkbox"><input type="checkbox" name="checkbox" checked="true"></input><i></i>Remember Me</label>
<h6><a href="/account-reset">Forgot Password ?</a> </h6>
<div class="clear"> </div>
</div>
<div class="submit">
<input type="submit" onclick="formSubmit()" value="SIGN IN" ></input>
</div>
<div class="social-icons">
<p>Or you can visit the following web</p>
<ul class="soc_icons2">
<li class="pic"><a href="https://www.facebook.com/facebook"><i
class="icon_4"></i></a></li>
<li class="pic"><a href="https://twitter.com/"><i
class="icon_5"></i></a></li>
<li class="pic"><a
href="https://cc.08800.top/webhp?gws_rd=cr"><i class="icon_6"></i></a></li>
<div class="clear"></div>
</ul>
</div>
<h5>Don't have an account ?<a href="/register"> Sign Up </a></h5>
</form>