PHP8.1.21版本已发布
vue8.1.21版本已发布
jquery8.1.21版本已发布

php占位符不能用怎么办

藏色散人
藏色散人 原创
2021-05-08 09:18:59 1713浏览

php占位符不能用是因为代码错误,其解决办法:首先打开相应的代码文件;然后将“placeholder "your name here"”修改为“placeholder="your name here"”即可。

本文操作环境:windows7系统、PHP7.1版,DELL G3电脑

错误代码:

<form role="search" method="get" id="searchform" class="searchform" action="<?php echo esc_url(home_url(&#39;/&#39;)); ?>">
  <input type="search" class="search rm-input" value="<?php echo get_search_query(); ?>" name="s" id="s" placeholder "Your name here"/>
  <input type="submit" style="display:none" id="searchsubmit" value="<?php echo esc_attr_x(&#39;Search&#39;, &#39;submit button&#39;); ?>" /></form>

我不知道为什么占位符文本没有在字段中显示…

解决方法:

代码中缺少“=”应该是:

placeholder="Your name here"

推荐学习:《PHP视频教程

声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。