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.

<form action="">
    <input type="text" placeholder="First name" required>
    <button type="submit">Submit</button>
Full Html cheatsheet