Textarea Element In HTML Form

  • Post category:HTML
  • Post author:
  • Post last modified:June 13, 2021
  • Reading time:3 mins read
You are currently viewing Textarea Element In HTML Form

Textarea Element

The textarea element in html form are used to take multi-line text input from users. This element are basically used for users message or any queries.

Textarea Element Syntax

The textarea element start with <textarea> tag and closed with </textarea> tag

<form action="action_page">
<label for="message">Write Your Message</label>
<textarea id="message" name="message" rows="8" cols="40"></textarea>
</form>

Result


Textarea Element Attribute

  • rows – The rows attribute defines the height of the textarea element.
  • cols – The cols attribute defines the width of the textarea element.

Textarea element – rows attribute

The rows attribute defines the how many rows of text line vertically should be fit in to the textarea box.

Example

<form action="action_page">
<label for="message">Write Your Message</label>
<textarea id="message" name="message" rows="8" cols="26"></textarea>
</form>

Result


Textarea element – cols attribute

The cols attribute defines how many number of characters horizontally should be fit under the text area element.

Example

<form action="action_page">
<label for="message">Write Your Message</label>
<textarea id="message" name="message" rows="8" cols="26"></textarea>
</form>

Result


Ashim Khatua

Professionally Web Developer since 2015, And also a Blogger. I am the founder of SiteCodings.com. I love to share my knowledge, which I earned the past few years. I want to share my knowledge with you through my Blog. Keep Reading.

Leave a Reply