Html 5 Form Required Attribute Tag

In the required attribute is used to must fill input type field and after submit button. Which will works to input types that are text,telephone,search,url,password, number, radio,date pickers,checkbox and file.

Syntax:

<input type="" required="required" />

Example Code



<!DOCTYPE HTML>
<form action="" method="post">
  Name:<input type="text" name="name" id="name" required="required" />
  <input type="submit" value="Submit" />
</form>

Out Put :

Name:

In the above example used required attribute for the Name input type.

ScreenShot :





Content