🔰browser-specific features
<script type="module">
// ⭐️ modules are deferred, can 'see' elements below.
console.lot(button); // HTMLButtonElement
</script>
<script>
// ⭐️ regular scripts run immediately, CAN'T 'see' elements below.
console.log(button); // ⛔️ ReferenceError: `button` not defined.
</script>
<button id="button">Button</button><!--
all dependencies fetched, and the script runs,
doesn't wait for the document or other <script>.
-->
<script async type="module">
import {counter} from './analytics.js';
counter.count();
</script>Last updated