I'm using the following code to generate a textarea
tag:
<%= text_area_tag :comment, '', autocomplete: "off", class: "form-control", placeholder: "Your Comment" %>
When rendered, it produces the following HTML:
<textarea name="comment" id="comment" autocomplete="off" class="form-control" placeholder="Your Comment"></textarea>
I know that if there is some text between <textarea>
and </textarea>
, the placeholder
won't show up, but in my case, there is nothing in-between, as it is clear from rendered HTML. So how can I put a placeholder
text for textarea
?
The html seems to be valid to me.
<textarea name="comment" autocomplete="off" class="test" id="moretest" data-value="moretest" placeholder="snowman or iceman?"></textarea>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With