HTML | <script> src Attribute Last Updated : 02 Jun, 2022 Comments Improve Suggest changes Like Article Like Report The HTML <script> src Attribute is used to specify the URL of external JavaScript file. The External JavaScript file is used to run on the same script on several pages on a website. We can save the JavaScript file with an extension of .js. We can refer the external script using the src attribute of the <script> element. Syntax: <script src="URL"> Attribute Values: It contains single value URL which specifies the URL of the external JavaScript file. There are two types of URL link which are listed below: Absolute URL: It points to another webpage.Relative URL: It points to other files of the same web page. Below example illustrates the <script> src attribute in HTML: Example: HTML <!DOCTYPE html> <html> <head> <title> HTML script src Attribute </title> </head> <body style="text-align:center;"> <h1> GeeksForGeeks </h1> <h2> HTML script src Attribute </h2> <script id="myGeeks" type="text/javascript" src="my_script.js"> </script> <br> <button>Submit</button> </body> </html> Output : Supported Browsers: The browser supported by HTML <script> src attribute are listed below: Google Chrome 1 and aboveEdge 12 and aboveFirefox 1 and aboveInternet ExplorerSafariOpera Comment More infoAdvertise with us Next Article HTML | <script> src Attribute M manaschhabra2 Follow Improve Article Tags : Web Technologies HTML HTML-Attributes Similar Reads HTML | <script> type Attribute The HTML <script> type Attribute is used to specify the MIME type of script and identify the content of the Tag. It has a Default value which is âtext/javascriptâ. Syntax: <script type="media_type"> Attribute Values: It contains a single value i.e media_type which specifies the MIME type 1 min read HTML | <source> src Attribute The HTML <source> src attribute is used to specify the URL of the media resource. The source element is used as a child element of the <audio> and <video> element. Syntax: <source src="URL"> Attribute Values: It contains single value URL which specifies the URL of the media r 1 min read HTML | <track> src Attribute The HTML <track> src Attribute is used to specify the URL of the track. Syntax: <track src="subtitles_en.vtt"> Attribute Values: It contains single value URL which is used to specify the URL of the track. Below example illustrates the use of src attribute in <track> element. Ex 1 min read HTML | <script> async Attribute The HTML,<script> async attribute is a boolean attribute. When present, it specifies that the script will be executed asynchronously when it is available. This attribute only works for external scripts (and used only in when src attribute is present ).Note: There are so many ways in which exte 1 min read HTML | <source> srcset Attribute The HTML srcset attribute is used to specifies the URL of an image to use in different situations. when <source> is used in <picture> it is requiredSyntax: <source srcset="URL"> Attribute Values URL: It specifies the URL of image Example: html <!DOCTYPE html> <html> 1 min read HTML | <input> src Attribute The HTML <input> src Attribute is used to specify the URL of the image to be used as a submit button. This attribute can only be used with <input type="image">.Syntax: <input src="URL"> Attribute Values: It contains a single value URL that specifies the link of the source image. Th 1 min read HTML | <script> charset Attribute The HTML <script>charset Attribute is used to specifies the character encoding used in an external script. Syntax: <script charset="charset"> Note: HTML <script>charset Attribute is not supported by HTML5. Attribute Values: It contains the value charset which specifies the characte 1 min read HTML <img> src Attribute The <img> src attribute is used to specify the URL of the source image. It points to the location of the image file that the browser should display on the webpage. Syntax:<img src="URL">Attribute Values: It contains a single-value URL that specifies the link to the source image. There ar 1 min read HTML | <embed> src Attribute The HTML <embed> src Attribute is used to specify the web address of the embedded content. Syntax: <embed src="URL"> Attribute Values: URL: It is used to specify the web address of the embedded content.An absolute URL: It points to another webpage.A relative URL: it points to a file with 1 min read HTML | <video> src Attribute The HTML <video> src Attribute is used to specify the URL of the video file. This attribute uses Ogg file on Firefox, Opera and Chrome browsers and MPEG4 file on Internet Explorer and Safari browsers. This attribute is new in HTML5. Syntax: <video src="URL"> Attribute Values: It contains 1 min read Like