加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 资源网站 > 资源 > 正文

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;">

让我知道它是否有效

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读