0

当我呈现网页时,输入字段显示占位符“输入关键字”,但文本区域不显示占位符。我哪里错了?

 <div>
        <textarea id="paragraph" rows="5" cols="35" placeholder="Enter the paragraph here..." value = ''>
        </textarea>
    </div>
    <div>
        <input type="text" id="word" placeholder="Enter the keyword here..." value="">
    </div>

4

1 回答 1

4

改变这个

<div>
    <textarea id="paragraph" rows="5" cols="35" placeholder="Enter the paragraph here..." value = ''>
    </textarea>
</div>

对此

<div>
    <textarea id="paragraph" rows="5" cols="35" placeholder="Enter the paragraph here..." value = ''></textarea>
</div>

文本区域将空格作为值,因为结束标记前有空格

于 2021-09-01T13:35:25.207 回答