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条)

报告相同问题?

悬赏问题

  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
  • ¥15 关于#hadoop#的问题
  • ¥15 (标签-Python|关键词-socket)
  • ¥15 keil里为什么main.c定义的函数在it.c调用不了
  • ¥50 切换TabTip键盘的输入法
  • ¥15 可否在不同线程中调用封装数据库操作的类
  • ¥15 微带串馈天线阵列每个阵元宽度计算
  • ¥15 keil的map文件中Image component sizes各项意思
  • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
  • ¥15 划分vlan后,链路不通了?