Is it autofocus=“ autofocus” or autofocus in HTML5?

HTMLJavascriptProgramming Scripts

As stated by w3.org −

The autofocus attribute is a boolean attribute. The presence of a boolean attribute on an element represents the true value, and the absence of the attribute represents the false value.

If the attribute is present, its value must either be the empty string or a value that is an ASCII case-insensitive match for the attribute's canonical name, with no leading or trailing whitespace.

In HTML, use boolean attributes with or without values. For W3C, autofocus can be easily written autofocus or autofocus = "autofocus" or,

autofocus = "".
raja
Published on 21-Mar-2018 10:37:03
Advertisements