HTML DOM Script text Property Last Updated : 21 Jun, 2023 Comments Improve Suggest changes Like Article Like Report 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 the <script> element. Return Values: It returns a string value that represents the content of the script element. i.e. all the Text nodes of the script but ignore the comments. Example 1: This Example is used to return the text Property. HTML <!DOCTYPE html> <html> <head> <title> DOM script text Property </title> </head> <body style="text-align:center;"> <h1> GeeksForGeeks </h1> <h2> DOM script Text property </h2> <script id="myGeeks" type="text/javascript"> document.write("Hello GeeksForGeeks"); </script> <br> <br> <button onclick="Geeks()"> Submit </button> <h2 id="demo"></h2> <script> function Geeks() { let x = document.getElementById("myGeeks").text; document.getElementById("demo").innerHTML = x; } </script> </body> </html> Output: Example 2: This Example is used to set the text Property. HTML <!DOCTYPE html> <html> <head> <title> DOM script text Property </title> </head> <body style="text-align:center;"> <h1> GeeksForGeeks </h1> <h2> DOM script Text property </h2> <script id="myGeeks" type="text/javascript"> document.write("Hello GeeksForGeeks"); </script> <br> <br> <button onclick="Geeks()"> Submit </button> <h2 id="demo"></h2> <script> function Geeks() { let x = document.getElementById( "myGeeks").text = "Script Content will be changed now"; document.getElementById("demo").innerHTML = x; } </script> </body> </html> Output: Supported Browsers: The browsers supported by HTML | DOM Script text Property are listed below: Google Chrome 1 and aboveEdge 12 and aboveInternet ExplorerFirefox 1 and aboveApple SafariOpera Comment More infoAdvertise with us Next Article HTML DOM Script text 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 src Property 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 Propert 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 Style textIndent Property The DOM Style textIndent Property is used for indentation of the first line in each block of text. It also takes negative values. If the value is negative then the first line will be indented to the left. Syntax: It is used to set the textIndent property:object.style.textIndent = "length|%|initial|i 2 min read HTML | DOM Title text Property The DOM Title text Property is used to set or return the text of the title of the document. Syntax: It returns the text property.titleObject.textIt is used to set the text property.titleObject.text = text Property Values: It contains the value i.e text which is used to specify the text of the docume 2 min read HTML DOM textContent Property The textContent property in HTML is used to set or return the text content of the specified node and all its descendants. This property is very similar to nodeValue property but this property returns the text of all child nodes.Syntax: It is used to set the text of node. node.textContent = textIt is 2 min read HTML DOM Anchor Text Property The Anchor text Property in HTML DOM is used to set or return the text content of a link. Syntax: It returns the Anchor text property. anchorObject.textIt is used to set the Anchor text property. anchorObject.text = sometextProperty Values: It contains single value sometext which specifies the text 2 min read HTML DOM Style textDecoration Property The HTML DOM Style textDecoration property is used to set one or more decorations for a text. We can specify one or more text decorations for a text separated by spaces. It returns the textDecoration property that is given to the text. SyntaxIt returns the textDecoration property. object.style.textD 2 min read HTML | DOM Script Object The DOM Script Object is used to represent the HTML <script> element. The script element is accessed by getElementById(). Properties: async: It is used to specify the script is executed asynchronously. charset: It is used to specify the character encoding used in an external script file. defer 2 min read HTML DOM Style quotes Property The Style quotes Property in HTML DOM is used to set/return the type of quotation marks for embedded quotations. This element can be accessed by using getElementById() method. Syntax: To get the property.object.style.quotesTo set the property.object.style.quotes = "none | string string string string 2 min read Like