Skip to main content

HTML Guide

Bad value “X” for attribute “async” on element “script”.

The async attribute is boolean: the presence of a boolean attribute on an element represents the true value, and the absence of the attribute represents the false value. As a boolean attribute, it does not need to be passed any value such as true or 1 to activate the async property.

For classic scripts, if the async attribute is present, then the classic script will be fetched in parallel to parsing and evaluated as soon as it is available.

For module scripts, if the async attribute is present then the scripts and all their dependencies will be executed in the defer queue, therefore they will get fetched in parallel to parsing and evaluated as soon as they are available.

<script async src="app.js"></script>

<script async type="module">
  /* JavaScript module code here */
</script>

Learn more:

Related W3C validator issues