HTML <script> Tag Last Updated : 27 Aug, 2024 Comments Improve Suggest changes Like Article Like Report The HTML <script> tag embeds client-side scripts or links to external JavaScript files, enabling dynamic content, form validation, and style manipulation. Attributes like async, defer, and src control script execution and loading, enhancing the interactivity and performance of web pages.Syntax// For Internal JavaScript Linking<script> Script Contents... </script>// For External JavaScript Linking<script src="script.js"></script>AttributesAttributesDescriptionsasyncIt is used to specify the script is executed asynchronously.cross-originIt is used for loading an external script into their domain from a third-party server or another domain with the support of HTTP CORS Request.deferIt is used to specify that the script is executed when the page has finished parsing.integrityIt is used to give permission to the Browser to check the fetched script to make ensure the source code is never loaded.nomoduleIt indicates that the script should not execute in the browsers that support ES module. It is a boolean attribute.nonceIt is used by Content Security Policy to check whether a given fetch will be allowed to proceed for a given element or not.referrerpolicyIt is used to specify the reference information that will be sent to the server when fetching the script. srcIt is used to specify the URL of an external script file.typeIt is used to specify the media type of the script.Note: This tag supports all the Global attributes.Example 1: Add script tag inside the body section of HTML document. HTML <!DOCTYPE html> <html> <head> <title>HTML script Tag</title> </head> <body> <h2>HTML script Tag</h2> <p id="GFG"></p> <!-- HTML script Tag Starts Here --> <script> document.getElementById("GFG").innerHTML = "Hello GeeksforGeeks!"; </script> <!-- HTML Script Tag Ends Here --> </body> </html> Output: HTML script tag example OutputExample 2: Add script tag inside the head section of HTML document. HTML <!DOCTYPE html> <html> <head> <title>HTML script Tag</title> </head> <body> <h1>GeeksforGeeks</h1> <h2>HTML script Tag</h2> <button type="button" onclick="Geeks()"> Hello GeeksforGeeks </button> <script> function Geeks() { alert('Welcome to GeeksforGeeks!'); } </script> </body> </html> Output: Supported Browsers Google Chrome: Version 38 and laterFirefox: Version 33 and laterMicrosoft Edge: Version 13 and laterOpera: Version 25 and laterSafari: Version 9 and later Comment More infoAdvertise with us V vt_m Follow Improve Article Tags : Web Technologies HTML HTML-Tags Similar Reads HTML DOCTYPE Declaration HTML DOCTYPE (Document Type Declaration) is an instruction that appears at the beginning of an HTML document, before the <html> tag.Its primary role is to tell the web browser which version of HTML the page is written in, ensuring that the browser renders the content correctly. It is not an HT 4 min read HTML abbr Tag The <abbr> tag in HTML is used to represent abbreviations and provides additional information about them through the title attribute, which displays a tooltip when hovered over. It helps improve accessibility and SEO by offering context for the abbreviated text.It makes text clearer by explain 3 min read HTML acronym Tag The HTML <acronym> tag was used to define an acronym, providing a way to identify and explain abbreviated terms in web content. However, it's deprecated in favor of <abbr>, which serves the same purpose but is more semantically correct.Syntax:Â <acronym title=""> Short Form </acr 2 min read HTML < address> Tag The <address> tag in HTML is used to define contact information for the author or owner of a document or an article. It is typically used for information such as an address, email, or phone number.The <address> element is a block-level element by default.The content inside <address 3 min read HTML a Tag The <a> tag defines a hyperlink, which is used to link from one page to another. The most important attribute of the <a> element is the href attribute, which indicates the link's destination. This attribute determines where the user is directed upon clicking the link.HTML<a href="http 2 min read HTML applet Tag The applet tag in HTML was used to embed Java applets into any HTML document. The <applet> tag was deprecated in HTML 4.01, and its support has been completely discontinued starting from HTML 5. Alternatives available in HTML 5 are the <embed> and the <object> tags. Some browsers s 2 min read HTML area Tag This <area> tag is used in an HTML document to map a portion of an image to make it clickable by the end user. This specifies the location and size of the active region on an image, which can be clicked. Clicking on areas with href attributes directs to a specified URL or action.html<!DOCTY 3 min read HTML article Tag The HTML <article> tag defines a self-contained, independent piece of content like a blog post, news article, or comment. It is designed for content that can be independently distributed, shared, or reused, providing semantic meaning to the content.This tag is introduced in HTML5.HTML<!DOCT 3 min read HTML aside Tag The <aside> tag is used to describe the main object of the web page more shortly like a highlighter. It identifies the content that is related to the primary content of the web page but does not constitute the main intent of the primary page. The <aside> tag contains mainly author inform 2 min read HTML5 < audio> Tag The <audio> tag in HTML5 is used to embed audio content on a webpage. It allows you to play audio files like MP3, OGG, or WAV directly in the browser. The <audio> element provides attributes for controlling playback, such as play, pause, and volume.Using the <source> element enable 3 min read Like