Working with Client-side Script
Tip: Ideally, script elements should be placed at the bottom of the page, before the closing body tag i.e.
</body>, because when browser encounters a script it pauses rendering the rest of the page until it parses the script that may significantly impact your site performance.
.js extension), and call that file in your HTML document through the
src attribute of the
This is useful if you want the same script 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 following example demonstrates how to link external JS file in HTML.
Note: When the
src attribute is specified, the
<script> element must be empty. This simply means that you cannot use the same
The HTML noscript Element
This element can contain any HTML elements, aside from
<script>, that can be included in the
<body> element of a normal HTML page. Let's check out an example:
Note: The content inside the
noscript element will only be displayed if the user's browser doesn't support scripting, or scripting is disabled in the browser.