<form action="demo-form.php">
Username: <input type="text" name="usrname" required>
<input type="submit">
</form>
Definition and Usage
required attribute is a Boolean attribute.
required attribute specifies that an input field must be filled in before submitting the form.
Note: required attribute applies to the following input types: text, search, url, tel , email, password, date pickers, number, checkbox, radio and file.