HTML DOM Script src Property Last Updated : 21 Jun, 2023 Comments Improve Suggest changes Like Article Like Report The DOM Script src Property is used to set or return the value of the src attribute of an <script> element. The src attribute specifies the URL of the External Javascript file. Syntax: It returns the src property:scriptObject.srcIt is used to set the src property:scriptObject.src = URL Property Values: It contains the value i.e. URL which specifies the URL of the External Javascript File. Two Types of URLs: An Absolute URL: It points to another website.A relative URL: it points to a file within the website. Return Value: It returns a string value that represents the URL of the External Javascript File. Example: This Example returns the src Property. HTML <!DOCTYPE html> <html> <head> <title> DOM script src Property </title> </head> <body style="text-align:center;"> <h1> GeeksForGeeks </h1> <h2> DOM script src property </h2> <script id="myGeeks" type="text/javascript" src="my_script.js"> </script> <br> <button onclick="Geeks()"> Submit </button> <h2 id="demo"></h2> <script> function Geeks() { let x = document.getElementById( "myGeeks").src; document.getElementById( "demo").innerHTML = x; } </script> </body> </html> Output: Supported Browsers: The browsers supported by HTML DOM Script src Property are listed below: Google ChromeInternet ExplorerFirefoxApple SafariOpera Comment More infoAdvertise with us Next Article HTML DOM Script src Property M manaschhabra2 Follow Improve Article Tags : Web Technologies HTML Web technologies HTML-DOM Similar Reads HTML DOM Script type Property The DOM Script type Property is used to set or return the value of the type attribute of a <script> element. The type attribute is used to specify the MIME type of a script. and identify the content of the <script> Tag. It has a Default value which is "text/javascript". Syntax: It is use 2 min read HTML DOM Script text Property The HTML DOM Script text Property is used to set or return the content of the <script> element. Syntax: It Returns the text property:scriptObject.textIt is used to set the text property:scriptObject.text = contents Property Values: It contains the value i.e contents that specify the content of 2 min read HTML DOM Source src Property The Source src Property in HTML DOM is used to set or return the value of the src attribute in a <source> element. The src attribute is used to specify the URL of the media resource. Syntax: It returns the Source src property. sourceObject.srcIt is used to set the Source src property.sourceObj 2 min read HTML | DOM Track src property The DOM track src property is used to set or return the value of the src attribute which shows the URL of the text track. Syntax: It is used to return the Track src property. trackObject.src It is also used to set the Track src property. trackObject.src = URL Value: URL: It is used to specify the UR 1 min read HTML DOM Script defer Property The Script defer Property is used to set or return whether the script should be executed after the page has finished parsing. This Property is used to reflect the defer attribute of a <script> Tag. This attribute is only used for External JavaScript File. Syntax: It Returns the defer property. 1 min read HTML DOM Script charset Property The HTML DOM Script charset property is used to set or return the value of a charset attribute of an <script> element. The charset attribute is used to specify the character encoding used in an external script. Syntax: It returns the charset property. scriptObject.charsetIt is used to set the 2 min read HTML DOM URL Property The DOM URL property in HTML is used to return a string that contains the complete URL of the current document. The string also includes the HTTP protocol such as ( http://).Syntax:document.URLReturn Value: It returns a string value that represents the full URL of the document. Example: In this exam 2 min read HTML | DOM Track srclang property The DOM track srclang property is used to set or return the value of the srclang attribute which shows the language of the text track. Note: srclang attribute is required with kind = "subtitles" Syntax: It is used to return the Track srclang property. trackObject.srclang It is also used to set the T 1 min read SVG Document.scripts Property The SVG Document.scripts property returns the list of script element in the document. Syntax: var scriptList = document.scripts Return value: This property returns the list of script element in the document. Example 1: HTML <!DOCTYPE html> <html> <body> <script></script 1 min read Like