Articles → HTML 5 → Required attribute in HTML5

Required attribute in HTML5






Purpose





Syntax


<input type="text" required/>



Example


<!DOCTYPE html>
<html lang="en">
<head>
    <title></title>   
</head>
<body>
   <form>
       <input type="text" required/>
       <input type="submit" />
   </form>
</body>
</html>



Output



Click to Enlarge


Browser support


Internet ExplorerFirefoxChromeSafariOperaEdge
10.04.05.010.19.6Yes



Posted By  -  Karan Gupta
 
Posted On  -  Saturday, November 24, 2018

Query/Feedback


Your Email Id  
 
Subject 
 
Query/FeedbackCharacters remaining 250