标签:class style 代码 log html 问题 数据 方法 la html中,placeholder作为input的一个属性,起到了在输入框中占位并提示的作用。 但是有一些浏览器,如chrome,当鼠标点击输入框时,placeholder的值不消失,只有输入数据才消失,会使前端用户体验大打折扣。 看了很多大神的方法,写了长长的js,看着有点吃力,就想到了下面这种最傻的方法解决了这个问题。 html代码: <input type="text" placeholder="请输入"> 在其中只需加入两个简短的js即可: <input type="text" placeholder="请输入" onfocus="this.placeholder=‘‘" onblur="this.placeholder=‘请输入‘">
解决默写浏览器中点击input输入框时,placeholder的值不消失的方法 标签:class style 代码 log html 问题 数据 方法 la 原文:http://www.cnblogs.com/KKatherine/p/4272853.html |
|