Input输入框提示

HTML:

<input type="text" value="用户名" class="gray" onclick="if(this.value=='用户名'){this.value='';this.className='black'}" onblur="if(this.value=='') {this.value='用户名';this.className='gray'}" />

 

CSS:

.black {color:#000;}   .gray {color:#b3b3b3;}

posted @ 2015-06-09 15:40  小鸟快飞  阅读(169)  评论(0)    收藏  举报