HTML textarea wrap property
Examples
Text area with wrap = "hard" will contain the newline (if any line breaks) when the form is submitted:
<textarea rows="2" cols="20" wrap="hard">
本教程提供了最全的web技术教程。
</textarea>
本教程提供了最全的web技术教程。
</textarea>
try it"
Browser Support
All major browsers support wrap property.
Definition and Usage
wrap attribute specifies when the form is submitted the text area is how to wrap the text.
Differences between HTML 4.01 and HTML5
wrap property is a new property in HTML5 <textarea> tag.
grammar
<textarea wrap=" soft|hard ">
Property Value
值 | 描述 |
---|---|
soft | 在表单提交时,textarea 中的文本不换行。默认。 |
hard | 在表单提交时,textarea 中的文本换行(包含换行符)。当使用 "hard" 时,必须指定 cols 属性。 |
HTML <textarea> tag