我想在我的输入框占位符中添加一个换行符。
但是它不起作用。有没有人能帮我实现这个?
<div class="form-group">
<input type="text" class="form-control ph" id="" placeholder="Qualification Education Background *">
</div>
我尝试使用
<div class="form-group">
<input type="text" class="form-control ph" id="" placeholder="Qualification\n</br> Education\n <br>Background *">
</div>
但是它不起作用。有没有人能帮我实现这个?
<textarea>
或<div contenteditable='true'>
,而不是<input>
。<input>
不能呈现HTML。<textarea>
不能呈现HTML,但可以有多行。带有contenteditable
属性的元素可以呈现HTML,但您需要使用一些JS来模拟占位符。 - zer00ne