html中input文本框,初始里边有文字提示,当点击时,文字消失

js解决方法
使用onfocus事件检查当前值,如果是默认值,就将value属性置空.如:
<input type="text" value="请输入内容" onfocus="javascript:if(this.value=='请输入内容')this.value='';">
----------------------------------------------------------
HTML5的placeholder属性的实现方法
<input type="text" value="请输入文字" onfocus="this.value=''" onblur="if(this.value==''){this.value='请输入文字'}" />
原文地址:https://www.cnblogs.com/wangxy/p/4906639.html