# Bad value “true” for attribute “defer” on element “script”.

> Canonical HTML version: https://rocketvalidator.com/html-validation/bad-value-true-for-attribute-defer-on-element-script
> Attribution: Rocket Validator (https://rocketvalidator.com)
> License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/)

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

```html
<script src="app.js" defer="true"></script>
```

## Good Example

```html
<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.
