placeholder 是HTML5的新属性,在做input 的预设值还挺方便的,但无奈IE8以下不支持,因此需要额外做fix。在实际使用中,却遇到了很多问题:
例如在官网查到的plugin:http://plugins.jquery.com/project/input-placeholder,就不支持type="password"的结果。因为仅改变value,对应password的显示方式
以下是我找到支持度最好地plugin:
DEMO: http://mathiasbynens.be/demo/placeholder
plugin: https://github.com/mathiasbynens/Placeholder-jQuery-Plugin