HTML <textarea> ห่อแอตทริบิวต์
ตัวอย่าง
ข้อความในพื้นที่ข้อความที่มี wrap="hard" จะมีขึ้นบรรทัดใหม่ (ถ้ามี) เมื่อส่งในรูปแบบ:
<textarea rows="2" cols="20" wrap="hard">
At W3Schools you will find free Web-building tutorials.
</textarea>
ความหมายและการใช้งาน
แอตทริบิวต์wrap
ระบุว่าจะห่อข้อความในพื้นที่ข้อความอย่างไรเมื่อส่งในแบบฟอร์ม
รองรับเบราว์เซอร์
Attribute | |||||
---|---|---|---|---|---|
wrap | Yes | Yes | Yes | Yes | Yes |
ไวยากรณ์
<textarea wrap="soft|hard">
ค่าแอตทริบิวต์
Value | Description |
---|---|
soft | The text in the textarea is not wrapped when submitted in a form. This is default |
hard | The text in the textarea is wrapped (contains newlines) when submitted in a form. When "hard" is used, the cols attribute must be specified |
❮ แท็ก HTML <textarea>