The <script> tag allows users to insert client-side scripts or data blocks in a document.
Scripts may be designed to provide interactivity, calculate and display values or run animations and other tasks.
src attribute is be used to add an external scripts file to the current web page.
In the above example, sample.js script file is imported, Click here to see that script file.
async attribute instructs the browser to execute the script first, and after completely executing the script the other process starts to load.
In the below example, the <h1> element will appear after closing the alert box.
In the below example, the <h1> element will appear simultaneously with the alert box.