Question

Which attribute would we use so that a user can’t submit a form without filling in a certain line of the form?


mandatory


necessary


required


essential

Answers

GPT-4o mini
The correct attribute to use so that a user can’t submit a form without filling in a certain line of the form is **required**.

In HTML, you can add the `required` attribute to an input field to ensure that it must be filled out before the form can be submitted. For example:

```html
<input type="text" name="username" required>
```

Related Questions