Open In App

HTML | <textarea> wrap Attribute

Last Updated : 22 Jul, 2022
Improve
Improve
Like Article
Like
Save
Share
Report

The HTML textarea wrap Attribute is used to specify that in which manner the text is to be wrapped in a text area when a form is submitted.

Syntax: 

<textarea wrap="soft|hard"> 

Attribute Values: 

  • soft: It specifies that the Text present in the Textarea would not be wrapped after submitting the form. This is the default value.
  • Hard: It specifies that the Text in a Textarea is wraps when submitting the form.

Example: This Example that illustrates the use of wrap attribute in the Textarea Element. 

html




<!DOCTYPE html>
<html>
 
<head>
    <title>
        HTML Textarea wrap attribute
    </title>
</head>
 
<body style="text-align:center">
    <h1 style="color: green;">
    GeeksforGeeks
</h1>
    <h2>
    HTML Textarea wrap attribute
</h2>
 
    <!-- Assigning id to textarea. -->
    <textarea id="GFG_ID"
              rows="3"
              cols="10"
              name="Geeks"
              wrap="hard">
        This text is wrapped in the text area field.
    </textarea>
    <br>
 
    <button onclick="myGeeks()">
        Submit
    </button>
</body>
 
</html>


Output:

  

Supported Browsers:

  • Google Chrome 16
  • Edge 12
  • Firefox 4
  • Internet Explorer 6
  • Opera 12.1
  • Apple Safari 6

Similar Reads

HTML | DOM Textarea wrap Property
The DOM Textarea wrap Property is used to set or return the value of the wrap attribute of the textarea. It describes the way the text to be wrapped while submitting a form. Syntax: It is used to return the wrap property.textareaObject.wrapIt is used to set the wrap property.textareaObject.wrap = soft|hard Property Values: soft: It defines that the
2 min read
HTML | wrap Attribute
The wrap attribute is used to specify that in which manner the text is to be wrapped in a text area when a form is submitted. The wrap attribute can be applied on the &lt;textarea&gt; element: Supported Tags: &lt;Textarea&gt; Attribute Values: soft: This is a default value. It specifies that the Text present in the Textarea would not be wrapped aft
1 min read
HTML &lt;textarea&gt; disabled Attribute
The disabled attribute for &lt;textarea&gt; element in HTML is used to specify that the text area element is disabled. A disabled text area is un-clickable and unusable. It is a boolean attribute. Syntax: &lt;textarea disabled&gt;text content...&lt;/textarea&gt; Example: C/C++ Code &amp;lt;!DOCTYPE html&amp;gt; &amp;lt;html&amp;gt; &amp;lt;head
1 min read
HTML | &lt;textarea&gt; placeholder Attribute
The &lt;textarea&gt; placeholder attribute in HTML is used to specify the expected value to be displayed before user input in textarea element. Syntax: &lt;textarea placeholder="text"&gt; Attribute Value: This attribute contains single value text which is the initial string to be displayed before user input. Example 1: This example uses &lt;textare
2 min read
HTML &lt;textarea&gt; autofocus Attribute
The HTML &lt;textarea&gt; autofocus Attribute is used to specify that the textarea field should get automatically focus when the page loads. It is a Boolean Attribute. Syntax: &lt;textarea autofocus&gt; Example: This Example illustrates the use of autofocus attribute in Textarea Element. C/C++ Code &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt;
1 min read
HTML | &lt;textarea&gt; cols Attribute
The HTML &lt;textarea&gt; cols Attribute is used to tell the browser how many average-width characters should fit on a single line i.e the number of columns to display. It is used to specify the visible width of the &lt;Textarea&gt; Element. Syntax: &lt;textarea cols="number"&gt; Attribute Values: It contains the value i.e number which specifies th
1 min read
HTML | &lt;textarea&gt; required Attribute
The HTML &lt;textarea&gt; required Attribute is a Boolean attribute which is used to specify that the &lt;textarea&gt; element must be filled out before submitting the Form. Syntax: &lt;textarea required&gt; Example: This Example illustrates the use of required attribute in Textarea Element. C/C++ Code &amp;lt;!DOCTYPE html&amp;gt; &amp;lt;html
1 min read
HTML | &lt;textarea&gt; name Attribute
The HTML &lt;textarea&gt; name Attribute is used to specify a name of the &lt;Textarea&gt; Element. It is used to reference the form-data after submitting the form or to reference the element in a JavaScript. Syntax: &lt;Textarea name="text"&gt; Attribute Values: It contains the value i.e name which specify the name for the &lt;Textarea&gt; element
1 min read
HTML | &lt;textarea&gt; form Attribute
The HTML &lt;textarea&gt; form Attribute is used to specify the one or more forms that the &lt;Textarea&gt; element belongs to.Syntax: &lt;Textarea form="form_id"&gt; Attribute Values: form_id: It Contains the value i.e form_id which specify the one or more form that the Textarea element belongs to. The value of this attribute should be id of the
1 min read
HTML | &lt;textarea&gt; rows Attribute
The HTML textarea rows Attribute is used to specify the number of visible text lines for the control i.e the number of rows to display. It also specifies the visible height of the Textarea. Syntax: &lt;textarea rows = "value"&gt; Attribute Values: number: It specify the height of the Textarea. Its Default value is 2. Example: C/C++ Code &amp;lt;!DO
1 min read