<script>

The script element embeds or references executable JavaScript or other scripts.

Since HTML 3.2 Spec ↗

Syntax

<script src="url"></script>

Examples

<script type="module" src="/app.js"></script>
<script>
  console.log('inline');
</script>
Output
Loads an ES module deferred and runs an inline log; no visible output beyond console.

Notes

type="module" implies deferred execution and strict mode. Use defer or async for classic scripts to avoid blocking parsing. Inline scripts are blocked by strict CSP unless a nonce or hash is used.

Browser & runtime support

EnvironmentSince version
chrome 1.0
firefox 1.0
safari 1.0
edge 12

See also