duangangmo0583 2017-01-23 20:23
浏览 63
已采纳

从搜索栏html替换水印文本

I would like to change watermark text and pup-up text on my search bar.

Search box looks like on image bellow - I would like to change "Search ..." and "Search for:" texts:

Search bar

Search box code from searchform.php :

 <div class="search-wrapper">

<form role="search" method="get" class="search-form" action="<?php echo esc_url( home_url( '/' ) ); ?>">

    <label>

        <span class="screen-reader-text"><?php echo _x( 'Search for:', 'label', 'Tesseract' ) ?></span>             

        <input type="search" class="search-field placeholdit" value="<?php echo get_search_query() ?>" name="s" title="<?php echo esc_attr_x( 'Search for:', 'label', 'Tesseract' ) ?>" />

    </label>

    <input type="submit" class="search-submit" value="<?php echo esc_attr_x( 'Search', 'submit button', 'Tesseract' ) ?>" />

</form>

I find out that replacing "Search for:" changes the pop-up text but how to change watermark text?

  • 写回答

2条回答 默认 最新

  • doubushi0031 2017-01-23 21:13
    关注

    You could try add placeholder="New text" to input type="search" element.

    Additionally you could lookup whether you have some additional javascript that reacts with the element or its class (e.g. with class placeholdit).

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 深度学习根据CNN网络模型,搭建BP模型并训练MNIST数据集
  • ¥15 lammps拉伸应力应变曲线分析
  • ¥15 C++ 头文件/宏冲突问题解决
  • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
  • ¥50 安卓adb backup备份子用户应用数据失败
  • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
  • ¥15 请问Lammps做复合材料拉伸模拟,应力应变曲线问题
  • ¥30 python代码,帮调试,帮帮忙吧
  • ¥15 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建