Open In App

HTML | <input type=”number”>

The HTML <input type=”number”> is used to specify an input field for entering a number. 

Syntax: 



<input type="number">

Example: 




<!DOCTYPE html>
<html>
    <head>
        <title>
            HTML input type number
        </title>
    </head>
     
    <body style="text-align:center;">
 
        <h1 style="color:green;">
            GeeksForGeeks
        </h1>
 
        <h2>HTML &lt;Input Type="Number"&gt;</h2>
 
        <input type="number" id="myNumber"
                value="10">
    </body>
</html>                   

Output:



  

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

Article Tags :