兼容IE678的placeholder

jquery-placeholder.js是基于jquery的插件,对不支持placeholder的浏览器有非常好的兼容性,只需引入这个js文件,然后给所有Input元素调用一下placeholder方法即可

插件下载:https://github.com/mybedhome/jquery-placeholder

样式:

.placeholder { color: #a0a0a0; text-indent: 8px;text-indent: 48px;text-indent: 8px9;}
::-webkit-input-placeholder { color: #a0a0a0; }
:-moz-placeholder { color: #a0a0a0; }

text-indent: 48px; //ie8 hack写法

text-indent: 8px9; //ie9 hack写法

原文地址:https://www.cnblogs.com/toward-the-sun/p/5848459.html