gpt4 book ai didi

html - 占位符在 Firefox 中无法正常工作

转载 作者:太空宇宙 更新时间:2023-11-04 04:21:39 24 4
gpt4 key购买 nike

我知道旧版 firefox 不支持占位符。但是我的 firefox 是最新的,我可以在此页面上看到占位符:http://www.dzyngiri.com/demo/flat-ui-login-form/ .但是当我打开我的代码时,我看不到占位符。如果我使用 chrome 或 IE,我的确实会显示

    <form id="Signup">
<input type="text" placeholder="username" id='name' size="15px"><br>
<input type="password" placeholder="password" id='pw' size="10px"><br>
<input type="password" placeholder="retype-password" id='confirmPw' size="10px"><br>
<input type="text" placeholder="email" id='email' size="10px"><br>

最佳答案

如果您想要 JS 解决方案,它涵盖了所有浏览器。

<input name="username" type="text" value="Username" onfocus="if(this.value==this.defaultValue)this.value='';" onblur="if(this.value=='')this.value=this.defaultValue;">

关于html - 占位符在 Firefox 中无法正常工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18972702/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com