Advertisement
Home Open Editor ❯

HTML wrap Attribute

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>

Try this code ❯

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">


Applies to:

The wrap attribute can be used on the following element:

Element Attribute
<textarea> wrap

Advertisement

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.
Home Open Editor ❯
Advertisement