Placeholder attribute not supported in IE. Any suggestions?

后端 未结 6 2090
走了就别回头了
走了就别回头了 2020-12-30 02:22

What do you all use to support placeholder attributes in browsers?

Currently, am using:

https://github.com/mathiasbynens/Placeholder-jQuery-Plugin

Ha

6条回答
  •  臣服心动
    2020-12-30 02:54

    There are quite a few polyfill scripts for the placeholder attribute. Here's one that seems to work well.

    Just remember to call $('input, textarea').placeholder(); in your JS code, and possibly add a CSS rule, eg. .placeholder { color: #aaa }.

提交回复
热议问题