html – 占位符值未显示在chrome中?
发布时间:2020-12-14 19:40:33 所属栏目:资源 来源:网络整理
导读:这是我的代码.我不明白为什么占位符没有显示在资源管理器中.请帮忙. HTML代码 form method="post" input type="text" class="field" name="nom" placeholder="Votre Nom" input type="text" class="field" name="telephone" placeholder="Téléphone" cente
这是我的代码.我不明白为什么占位符没有显示在资源管理器中.请帮忙.
HTML代码 <form method="post" > <input type="text" class="field" name="nom" placeholder="Votre Nom"> <input type="text" class="field" name="telephone" placeholder="Téléphone"> <center><input type="submit" id="submit_btn" value="Valider" class="btn_submit"></center> </form> 解决方法
尝试使用OnFocus,而不是使用占位符,它将起作用
<input name="nom" type="text" value="Votre Nom" onfocus="if(this.value==this.defaultValue)this.value='';" onblur="if(this.value=='')this.value=this.defaultValue;"> 让我知道它是否有效 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |