在占位符中使用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。但是看到带有图标的搜索文本字段并不少见。有什么方法可以做到这一点?