HTML wrap Attribute

❮ HTML Attributes

Example

<form action="action.php">
	<label for="demo">textarea demo:</label>
	<textarea wrap="hard" id="demo" name="textareaText">Hello world!</textarea>
	<br><br>
	<input type="submit" value="Submit">
</form>

Meaning

The wrap attribute specifies how the control wraps text.

Note: If this attribute is not specified, soft is its default value.




Standard Syntax

<element wrap="hard|soft">



Browser Support




Status




Applies to:

The wrap attribute can be used on the following element:

Element Attribute
<textarea> wrap






Attribute Values

Value Description
off(not recommended) It forces the <textarea> element not to wrap text, so the viewer must manually enter line breaks.
hard Specifies the word wrap and includes line breaks in text submitted to the server.
soft Specifies the word wrap but removes line breaks from text submitted to the server.
❮ HTML Attributes