Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/53.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在占位符中使用html_Html_Ruby On Rails_Icons_Twitter Bootstrap_Placeholder - Fatal编程技术网

在占位符中使用html

在占位符中使用html,html,ruby-on-rails,icons,twitter-bootstrap,placeholder,Html,Ruby On Rails,Icons,Twitter Bootstrap,Placeholder,是否可以在占位符属性中使用html?例如,我想使用而不是搜索文本 =form_tag search_editions_path, method: :get, class: 'navbar-search pull-left' do =text_field_tag :q, nil, class: 'search-query', placeholder: 'Search' 不,占位符属性只接受纯文本,对于搜索文本输入,您可以在其上使用绝对定位元素,对于用户来说,它看起来像是在文本输入中。您能提供

是否可以在
占位符
属性中使用html?例如,我想使用
而不是
搜索
文本

=form_tag search_editions_path, method: :get, class: 'navbar-search pull-left' do
  =text_field_tag :q, nil, class: 'search-query', placeholder: 'Search'

不,占位符属性只接受纯文本,对于搜索文本输入,您可以在其上使用绝对定位元素,对于用户来说,它看起来像是在文本输入中。

您能提供您想要的HTML吗?并且编码的HTML字符可以用在占位符属性中(
而不是
对不起,这只是一个haml。但是看到带有图标的搜索文本字段并不少见。有什么方法可以做到这一点?