Adding a Script to HTML Document
<script> element is used to define a client-side script.
The script in the example below writes Hello World! to the HTML output:
Tip: Ideally, scripts should be placed at the bottom of the page, because scripts block parallel downloads. That will make your web pages load faster.
Calling an External Script
You can also place your scripts into a separate file, and then call that file through the src attribute in your HTML document. This is useful if you want the same scripts available to multiple documents — it saves you from repeating the same task over and over again, and makes your website much easier to maintain.
The HTML noscript Element
<noscript> element is used to provide an alternate content for users that have either disabled scripts in their browser or have a browser that doesn't support client-side scripting.
The noscript element can contain all the HTML elements that you'd include inside the
<body> element of a normal HTML page.
Note: The content inside the
noscript element will only be displayed if scripts are not supported, or are disabled in the user's browser.