Skip to content
Related Articles

Related Articles

HTML | <input type=”text”>

View Discussion
Improve Article
Save Article
  • Last Updated : 26 Jul, 2022

The HTML <input type=”text”> is used to define a single-line text field . The default width of the text field is 20 characters. 

Syntax: 

<input type="text">

Example: 

html




<!DOCTYPE html>
<html>
 
<head>
    <title>
        HTML input type text
    </title>
</head>
 
<body style="text-align:center;">
 
    <h1 style="color:green;">
        GeeksForGeeks
    </h1>
 
    <h2>
        HTML &lt;Input Type="text"&gt;
    </h2>
 
    <form>
        Name: <input type="text">
    </form>
</body>
 
</html>                   

Output:

  

Supported Browsers: The browsers supported by <input type=”text”> are listed below:

  • Google Chrome 1
  • Edge 12
  • Internet Explorer
  • Firefox 1
  • Safari 1
  • Opera
My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!