Skip to content
Related Articles

Related Articles

Improve Article

HTML | <input type=”text”>

  • Last Updated : 20 Oct, 2020

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:




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

Output:

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

  • Google Chrome
  • Internet Explorer
  • Firefox
  • Safari
  • Opera

Attention reader! Don’t stop learning now. Get hold of all the important HTML concepts with the Web Design for Beginners | HTML  course.

My Personal Notes arrow_drop_up
Recommended Articles
Page :