Input Type Text: Here’s How It Defines Text Entry Fields In HTML

Disclosure: Your support helps keep the site running! We earn a referral fee for some of the services we recommend on this page. Learn more
Value of
How To Define Input Type In HTML (All The Values And Attributes)
What does Input Type Text: Here’s How It Defines Text Entry Fields In HTML do?
Defines a text entry field in a form.

Code Example

<form action="myform.cgi">
<input type="text" name="text" id="text" maxlength="10">
<label for="text"> Type your name here</label>
<br><input type="submit" value="Submit">
</form>

The text value of input defines a single-line text entry field.

If you need to obfuscate the contents of a text entry field, for basic security purposes, uses the password input type instead.

Claire is seasoned technical writer, editor, and HTML enthusiast. She writes for HTML.com and runs a content agency, Red Robot Media.

Browser Support for text

iefirefoxchromeedgesafariopera
AllAllAllAllAllAll