<textarea rows="4" cols="50" name="subject">test</textarea>
<p>The <code><textarea></code> tag is used to create a multi-line text input field in a form. It allows users to input multiple lines of text, which can be submitted as part of a form submission.</p>
<p>The <code><textarea></code> tag has several attributes that can be used to customize its appearance and behavior:</p>
<ul>
<li><code>name</code>: Specifies the name of the text area. This name is used when the form is submitted to identify the input.</li>
<li><code>rows</code>: Specifies the number of rows that the text area will display. This controls the height of the text area.</li>
<li><code>cols</code>: Specifies the number of columns that the text area will display. This controls the width of the text area.</li>
<li><code>disabled</code>: Disables the text area, preventing it from being edited or clicked.</li>
<li><code>form</code>: Specifies the form that the text area belongs to. This attribute is useful if the text area is not inside a form element.</li>
<li><code>maxlength</code>: Specifies the maximum number of characters that can be entered in the text area.</li>
<li><code>placeholder</code>: Specifies a hint that will be displayed in the text area before the user inputs any text.</li>
<li><code>readonly</code>: Makes the text area read only, preventing it from being edited.</li>
<li><code>required</code>: Specifies that the text area must be filled out before submitting the form.</li>
</ul>
<p>Here’s an example of a basic <code><textarea></code>:</p>
<pre><code class="language-html"><form>
  <textarea name="message" rows="4" cols="50">Enter your message here</textarea>
</form>
<p>When the form is submitted, the value of the text area will be sent as part of the form data with the key <code>message</code>.</p>
<p>You can also set attributes like <code>disabled</code> or <code>readonly</code> to control the behavior of the text area:</p>
<pre><code class="language-html"><form>
  <textarea name="message" rows="4" cols="50" disabled>This text area is disabled</textarea>
</form>
<p>Or set attributes like <code>placeholder</code> or <code>required</code>:</p>
<pre><code class="language-html"><form>
  <textarea name="message" rows="4" cols="50" placeholder="Enter your message here" required></textarea>
</form>
<p>This will display a placeholder in the text area that the user can input their message in, and the form will not be submitted unless the text area is filled out.</p>

The

When the form is submitted, the value of the text area will be sent as part of the form data with the key message.

You can also set attributes like disabled or readonly to control the behavior of the text area:

Or set attributes like placeholder or required:

This will display a placeholder in the text area that the user can input their message in, and the form will not be submitted unless the text area is filled out.

close