我正在使用以下代码来生成textarea
tag:
<%= text_area_tag :comment, '', autocomplete: "off", class: "form-control", placeholder: "Your Comment" %>
渲染后,它会生成以下 HTML:
<textarea name="comment" id="comment" autocomplete="off" class="form-control" placeholder="Your Comment"></textarea>
我知道如果之间有一些文字<textarea>
and </textarea>
, the placeholder
不会显示,但就我而言,中间没有任何中间内容,从渲染的 HTML 可以清楚地看出。那么我怎样才能把placeholder
文本为textarea
?
html 似乎对我有效。
<textarea name="comment" autocomplete="off" class="test" id="moretest" data-value="moretest" placeholder="snowman or iceman?"></textarea>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)