<script>
The script element embeds or references executable JavaScript or other scripts.
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
| Environment | Since version |
|---|---|
| chrome | 1.0 |
| firefox | 1.0 |
| safari | 1.0 |
| edge | 12 |