模拟placeholder

Posted ww01

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了模拟placeholder相关的知识,希望对你有一定的参考价值。

把这个记下来,主要是因为这里的 defaultValue 我之前竟然不知道

  <input type="text" value="提示内容" onFocus="if(value==defaultValue){value=‘‘;this.style.color=‘#000‘}" onBlur="if(!value){value=defaultValue;this.style.color=‘#999‘}"
    style="color:#999;" />

 

以上是关于模拟placeholder的主要内容,如果未能解决你的问题,请参考以下文章

模拟placeholder

模拟placeholder

模拟placeholder

模拟ie9的placeholder

select标签模拟placeholder属性与一般操作(最重要的是ios某一项被选中的兼容)

js解决IE89下placeholder的兼容问题