A textbox is a common input control in HTML, but it has various hidden attributes. An HTML text box is an area on the screen wherein the user can enter the text input. It is a common input element found in many software programs, such as web browsers, email clients, and word processors. When you click on the text box, a cursor is enabled, indicating the user can begin typing. 

What is an HTML Textbox?

The HTML textbox is an input control that allows the user to enter the text input on the web page. The <input type = “text”>  is used to create a textbox.

single-line-text

output-single-line-text

Want a Top Software Development Job? Start Here!

Full Stack Developer - MERN StackExplore Program
Want a Top Software Development Job? Start Here!

Setting a Default Value for the Textbox

If you want to set the default value to a textbox, you can use the value attribute. Whenever the form is loaded, the default value is shown inside the textbox.

value-attribute-html-textbox

output-value

Multiline Textbox

The HTML <textarea> is a tag used within a form to declare a multiline textbox that allows the user to input text over multiple lines.

html-textarea

output-textarea

Specific Attributes of a Textbox

The HTML textbox supports the following attributes:

Attributes

Value 

Description

Autofocus

Autofocus

It specifies that the text box should automatically get focused when the page loads.

Cols

Number

It specifies the width of the text box.

Rows

Number

It specifies the height of the text box.

Wrap

Hard
soft

It specifies the text to be wrapped in a text box.

Disabled

Disabled

It specifies the width of the text box based on the number of visible characters.

Form

Form_id

It specifies one or more forms.

Maxlength

Number

It specifies the maximum number of characters in a text box.

Name

Text

It assigns the name to the text box.

Placeholder

Text

It specifies the short hint about the text box.

Browser Support

Chrome

Safari

IE 

Firefox

Opera

Android

Yes

Yes

Yes

Yes

Yes

Yes

Get skilled in HTML5 and CSS3 with the Full Stack Java Developer Master's Program. Click to check out the program details! 

Next Steps

We sincerely hope that this article on HTML textbox offered you a brief insight into how you can enter the text input on your web pages. Although this is informational, to learn more about web development in its entirety, an appropriate certification is highly recommended for jumpstarting your coding career. Simplilearn’s Full Stack Java Developer will help you master web development and help you enhance your skills. The course explores a wide range of relevant topics, that cover front-end, middleware, and back-end technologies of web development using Java. You will learn to build an end-to-end application, test and deploy code, store data using MongoDB, and much more.

If you have any questions or feedback regarding the HTML tags article, let us know in the comments section of this article. Our experts will get back to you on the same, as soon as possible.

Our Software Development Courses Duration And Fees

Software Development Course typically range from a few weeks to several months, with fees varying based on program and institution.

Program NameDurationFees
Caltech Coding Bootcamp

Cohort Starts: 16 Dec, 2024

6 Months$ 8,000
Automation Test Engineer Masters Program

Cohort Starts: 27 Nov, 2024

8 months$ 1,499
Full Stack Java Developer Masters Program

Cohort Starts: 18 Dec, 2024

7 months$ 1,449
Full Stack (MERN Stack) Developer Masters Program

Cohort Starts: 8 Jan, 2025

6 Months$ 1,449