Internet Explorer lack of placeholder support, specifically password fields
Ok, so to overcome IE's lack of support for HTML5's Placeholder attribute, I wrote some JS that loops over inputs and sets the value of the input to be the placeholder attribute value for browsers that don't support it. Now this works fine, however on password fields, whatever the value is, appears as dots/bullets to obscure passwords.
Now what measures and methods can I take to get around this?
To have a placeholder style effect but on an input[type="password"]?
In looking at the "Web Forms : input placeholder" section of HTML5 Cross Browser Polyfills, one I saw was jQuery-html5-placeholder.
I tried the demo out with IE9, and it looks like it wraps your <input>
with a span and overlays a label with the placeholder text.
<label>Text:
<span style="position: relative;">
<input id="placeholder1314588474481" name="text" maxLength="6" type="text" placeholder="Hi Mom">
<label style="font: 0.75em/normal sans-serif; left: 5px; top: 3px; width: 147px; height: 15px; color: rgb(186, 186, 186); position: absolute; overflow-x: hidden; font-size-adjust: none; font-stretch: normal;" for="placeholder1314588474481">Hi Mom</label>
</span>
</label>
There are also other shims there, but I didn't look at them all.
Refered from Input placeholders for Internet Explorer
链接地址: http://www.djcxy.com/p/70568.html