HTML

HTML Intro

HTML Intro Quiz

HTML Intro Exercise

HTML Basics

HTML Basic Quiz

HTML Basic Exercise

HTML Advance

HTML Advance Quiz

HTML Advance Exercise

HTML Tags List

HTML Global Attributes

HTML Attributes

FAQs

HTML script Tag

HTML script Tag

 

 

The script tag is used to embed a client-side script. It either contains scripting statements or points to the external script file.

 

Uses of script tag:-

 

  • DOM Manipulation
  • Content Manipulation
  • Form Validation
  • Image Validation
  • Adding different effects and transitions

 

Attribute Explanation:-

 

Attribute Value Description
async async Specifies that the script is downloaded in parallel to parsing the page, and executed as soon as it is available.
crossorigin anonymous
use-credentials
Sets the mode of the request to an HTTP CORS Request
defer defer Specifies that the script is downloaded in parallel to parsing the page, and executed after the page has finished parsing (only for external scripts)
integrity filehash Allows a browser to check the fetched script to ensure that the code is never loaded if the source has been manipulated
nomodule True
False
Specifies that the script should not be executed in browsers supporting modules
referrerpolicy no-referrer
no-referrer-when-downgrade
origin
origin-when-cross-origin
same-origin
strict-origin
strict-origin-when-cross-origin
unsafe-url
Specifies which referrer information to send when fetching a script
src URL Specifies the URL of an external script file
type scripttype Specifies the media type of the script

 

Syntax:-

 

Its syntax is:- < script >

Code Explanation

All Tutorials related to HTML Tags List

All Sections related to HTML