-1

What is the correct (or suggested) syntax for boolean html attributes? For example which one of the following should I use?

<input type="text" disabled>
<input type="text" disabled="disabled">
<input type="text" disabled="true">
Cœur
  • 37,241
  • 25
  • 195
  • 267
Ava
  • 2,038
  • 3
  • 23
  • 45

1 Answers1

-3

If you want to enter only Boolean like 0 or 1 in input field . Following is the correct way :-

<form>
  <input type="number" name="quantity" min="0" max="1">
  <br>
  <input type="submit">
</form>
  • The question is about the formatting of the attributes for the input tag, not what input tag will work for entering a boolean. – andrewsi Jun 09 '16 at 20:18