1. Home
  2. Html
  3. Required

Front-end solution for the user input validation. Submitting the form with an empty field will trigger the validation. NOTE. Front-end validate should not be the only way of checking the submitted data. You do need to check and validate all data on the back-end of the application.

#html#form#input#attribute
<form action="">
    <input type="text" placeholder="First name" required>
    <button type="submit">Submit</button>
</form>
Output:
copy
Full Html cheatsheet
NordVPN NordVPN