Is there a standard way of adding attributes like disabled, checked etc. to different input elements in HTML forms?
The MDN documentation (https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/disabled) simply seems to be using the shorthand version in its examples.
<option disabled>Option 2.2</option>
However, MDN didn't seem to mention anywhere is using disabled="disabled"
or simply disabled
is the correct way to do it. Does it not matter at all now?
The HTML spec (https://www.w3.org/TR/html51/sec-forms.html#enabling-and-disabling-form-controls-the-disabled-attribute) doesn't provide any examples.
There is an old related question What's the proper way to add selected and related attributes to inputs? but I am wondering if the spec or recommendations have changed since then.