HTML <script> Tag
The <script> tag embeds or references executable JavaScript. Use inline code between the tags or load an external file with the src attribute. Scripts block HTML parsing by default; use defer or place at end of body for better performance.
src and inline
Inline: <script>code</script>. External: <script src="app.js"></script>. Do not put code inside the tag when using src. The type attribute defaults to text/javascript.
defer and async
defer: script runs after the document is parsed, in order. async: script runs when available, order not guaranteed. Use defer for DOM-dependent scripts; use async for independent scripts like analytics. Prefer defer or scripts at end of body to avoid blocking rendering.
