js实现placehoider效果

placeholder作为input输入框提示语很好用,但是低版本ie却不支持,对于只有提示语的输入框并不适用

<input type="text"  value="手机号" onFocus="this.value = '';" onBlur="if (this.value == '') {this.value = '手机号';}"/>

 通过焦点事件可以达到类似placehoider的效果

原文地址:https://www.cnblogs.com/lhj-blog/p/7741554.html