查看HTML5 Cross Browser Polyfills的“Web Forms:input placeholder”部分,我看到一个是jQuery-html5-placeholder。
我试过demo与IE9,它看起来像它包装你的<input>
跨度和覆盖与占位符文本的标签。
<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>
那里还有其他的垫片,但我没有看它们。
Refered从Input placeholders for Internet Explorer
你可以多写一些JavaScript的:P –
@SaadImran。只是想知道如何处理它... – benhowdle89
你可以,呃,将密码字段的背景色设置为透明,并在其下面放置一个白色的'DIV',它显示占位符... – Passerby