Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Textarea Element | Forms

Textarea ElementTextarea Element

The <textarea> element is a powerful tool for creating a multi-line text input field on a web page. It allows users to input and submit more significant amounts of text than the <input> element, which is limited to a single line of text.

The <textarea> element consists of an opening <textarea> tag and a closing </textarea> tag. Any text placed between these tags will serve as the default value for the text area.

Attributes

name - specifies the name of the text area, which is used to identify the field when the form is submitted.

rows and cols - determine the number of visible rows and columns of the text area, respectively. They allow us to specify the width and height of the text area.

placeholder - provides a short hint to the user about the expected information in the text area. It is displayed as a temporary placeholder until the user starts typing.

maxlength - specifies the maximum number of characters that can be entered in the text area. It helps enforce character limits or restrictions.

readonly - readonly attribute, when added to the <textarea> element, makes the field read-only, preventing users from modifying the text. It is useful when displaying pre-filled or non-editable content.

Example

html

index.html

css

index.css

js

index.js

1. Which input type is used for selecting a date?
2. Which attribute is used to set the maximum number of characters allowed in a text input field?
3. Which element is used to create a multi-line input field?
4. Which attribute is used to set the initial value of an input field?

Which input type is used for selecting a date?

Selecciona la respuesta correcta

Which attribute is used to set the maximum number of characters allowed in a text input field?

Selecciona la respuesta correcta

Which element is used to create a multi-line input field?

Selecciona la respuesta correcta

Which attribute is used to set the initial value of an input field?

Selecciona la respuesta correcta

¿Todo estuvo claro?

Sección 5. Capítulo 7

Textarea ElementTextarea Element

The <textarea> element is a powerful tool for creating a multi-line text input field on a web page. It allows users to input and submit more significant amounts of text than the <input> element, which is limited to a single line of text.

The <textarea> element consists of an opening <textarea> tag and a closing </textarea> tag. Any text placed between these tags will serve as the default value for the text area.

Attributes

name - specifies the name of the text area, which is used to identify the field when the form is submitted.

rows and cols - determine the number of visible rows and columns of the text area, respectively. They allow us to specify the width and height of the text area.

placeholder - provides a short hint to the user about the expected information in the text area. It is displayed as a temporary placeholder until the user starts typing.

maxlength - specifies the maximum number of characters that can be entered in the text area. It helps enforce character limits or restrictions.

readonly - readonly attribute, when added to the <textarea> element, makes the field read-only, preventing users from modifying the text. It is useful when displaying pre-filled or non-editable content.

Example

html

index.html

css

index.css

js

index.js

1. Which input type is used for selecting a date?
2. Which attribute is used to set the maximum number of characters allowed in a text input field?
3. Which element is used to create a multi-line input field?
4. Which attribute is used to set the initial value of an input field?

Which input type is used for selecting a date?

Selecciona la respuesta correcta

Which attribute is used to set the maximum number of characters allowed in a text input field?

Selecciona la respuesta correcta

Which element is used to create a multi-line input field?

Selecciona la respuesta correcta

Which attribute is used to set the initial value of an input field?

Selecciona la respuesta correcta

¿Todo estuvo claro?

Sección 5. Capítulo 7
some-alt