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
HTML Comment Tag
DOCTYPE in HTML
HTML a Tag
HTML abbr Tag
HTML acronym Tag
HTML address Tag
HTML article Tag
HTML aside Tag
HTML audio Tag
HTML b Tag
HTML base Tag
HTML bdi Tag
HTML bdo Tag
HTML blockquote Tag
HTML body Tag
HTML br Tag
HTML button Tag
HTML canvas Tag
HTML caption Tag
HTML cite Tag
HTML code Tag
HTML col Tag
HTML colgroup Tag
HTML data Tag
HTML datalist Tag
HTML dd Tag
HTML del Tag
HTML details Tag
HTML dfn Tag
HTML dialog Tag
HTML div Tag
HTML dl Tag
HTML dt Tag
HTML em Tag
HTML embed Tag
HTML fieldset Tag
HTML figcaption Tag
HTML figure Tag
HTML footer Tag
HTML form Tag
HTML h1 - h6 Tags
HTML head tag
HTML header Tag
HTML hr Tag
HTML html Tag
HTML i Tag
HTML iframe Tag
HTML img Tag
HTML input Tag
HTML ins Tag
HTML kbd Tag
HTML label Tag
HTML legend Tag
HTML li Tag
HTML link Tag
HTML main Tag
HTML mark Tag
HTML meta Tag
HTML meter Tag
HTML nav Tag
HTML noscript Tag
HTML object Tag
HTML ol Tag
HTML optgroup Tag
HTML option Tag
HTML output Tag
HTML p Tag
HTML param Tag
HTML picture Tag
HTML pre Tag
HTML progress Tag
HTML q Tag
HTML ruby Tag
HTML s Tag
HTML samp Tag
HTML script Tag
HTML section Tag
HTML select Tag
HTML small Tag
HTML source Tag
HTML span Tag
HTML strong Tag
HTML style Tag
HTML sub Tag
HTML summary Tag
HTML sup Tag
HTML svg Tag
HTML table Tag
HTML tbody Tag
HTML td Tag
HTML template Tag
HTML textarea Tag
HTML tfoot Tag
HTML th Tag
HTML thead Tag
HTML time Tag
HTML title Tag
HTML tr Tag
HTML track Tag
HTML u Tag
HTML ul Tag
HTML var Tag
HTML video Tag
HTML wbr Tag