// Normal Include
// Defer Include
<script src="demo.js" defer></script>
// Async Include
<script src="demo.js" async></script>
Async allows execution of scripts asynchronously and defer allows execution only after the whole document has been parsed.
With async, the file gets downloaded asynchronously and then executed as soon as it’s downloaded.
With defer, the file gets downloaded asynchronously but executed only when the document parsing is completed.
Just note this will not affect if you write the inline script.