The required attribute in HTML


 Use HTML5 to make a field required:

  • In our web forms, we have some fields that should not be skipped.
  • In order to make sure these particular fields are not skipped and the form is not accepted with any of these fields missing, we should make these fields required.
  • In HTML to we have a very special attribute required within the input element that makes sure that no input field is left empty.
    <input type="text" placeholder="cat photo URL" required>

    No comments:

    Post a Comment