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

HTMLJavascriptProgramming Scripts

As stated by −

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 = "".
Updated on 24-Jun-2020 13:31:55