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.
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.
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.
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 |
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.