欢迎访问我的博客,目前从事Machine Learning,欢迎交流

模拟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;" />

 

posted @ 2018-10-12 22:07  有蚊子  阅读(109)  评论(0编辑  收藏  举报