New! My 44-page ebook "CSS in 44 minutes" is out! 😃

Get it now →

# script

Defines a container for an external script.

Example: Copy

<script src="https://htmlreference.io/javascript/my-scripts.js"></script>

Example: Copy

<script type="text/javascript">
  console.log('Hello World');
</script>

src

Defines the source of the external script.

"/javascript/my-scripts.js"

The URL can be relative or absolute.

type

Defines the MIME type of the external script.

"text/javascript"

This is for .js files.

async

Allows the external script to be loaded asynchronously.

No value required.