About This HTML Issue
The defer attribute on the <script> element is a boolean attribute and should not be assigned a value like "true".
In HTML, boolean attributes don’t work like regular attributes. A boolean attribute is considered “true” simply by being present on the element, and “false” by being omitted entirely. Setting defer="true" is invalid because the only allowed values for a boolean attribute are either the empty string ("") or the attribute’s own name (e.g., defer="defer").
The defer attribute tells the browser to download the script in parallel with HTML parsing and execute it only after the document has been fully parsed. It only works on scripts with a src attribute — it has no effect on inline scripts.
Bad Example
<script src="app.js" defer="true"></script>
Good Example
<script src="app.js" defer></script>
This rule applies to all boolean attributes in HTML, such as disabled, checked, readonly, async, hidden, and others. Just include the attribute name by itself — no value needed.
Find issues like this automatically
Rocket Validator scans thousands of pages in seconds, detecting HTML issues across your entire site.