In HTML5 If I want to make the field to be required or compulsory

In html5 there is an attribute where it will make the field mandatory for the user, simple validation can be done with this attribute, does any know about this attribute and how to use it when for all input types.

Kid Asked on December 13, 2015 in HTML5 and CSS3.
Add Comment
  • 1 Answer(s)

      For any input field you have to write required text as an attribute. Please check below

      <input name="" type="text" required>

      As you can see attribute required which will restrict users in the front end submitting them with empty.

      Kid Answered on December 13, 2015.
      Add Comment

      Your Answer

      By posting your answer, you agree to the privacy policy and terms of service.