When we insert boolean attributes into elements ( tag ) <html>
we do not need to enter the true
value, and its simple presence already confirms, by default, that this attribute is active. Example:
<html lang="pt-BR" spellcheck>
<body>
<p contenteditable="true">Texto será verificado se conter erros!</p>
</body>
</html>
Note that the spellcheck
attribute on the html
element is without the "true"
value, however, the grammar will be checked on any child element of the html
root.
Question: Is it correct to use boolean attributes without entering their value? What is the advantage or disadvantage? Any usage convention? Thank you!