HTML DOM Style textDecoration Property Last Updated : 22 Apr, 2024 Comments Improve Suggest changes Like Article Like Report 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.textDecorationIt is used to set the textDecoration property. object.style.textDecoration = "none | underline | overline | line-through | blink | initial | inherit"Property Values Property Value Description noneIt is used to define a normal text. It is the default value.underlineIt defines a line under the text.overlineIt defines a line above the text.line-throughIt defines a line through the text.initialIt sets the textDecoration property to its default value.inheritThis property is inherited from its parent element.Return ValueIt returns a string representing the decoration given to the text. Example 1: In this example, we will set the textDecoration property value using HTML DOM (JavaScript). html <!DOCTYPE html> <html> <head> <title>HTML DOM Style textDecoration Property</title> </head> <body> <h2>HTML DOM Style textDecoration Property</h2> <p id="GFG"> A Computer science portal for geeks </p> <button onclick="myFunction()"> Set Text Decoration </button> <script> function myFunction() { document.getElementById("GFG").style .textDecoration = "underline"; } </script> </body> </html> Output: Example 2: In this example, we will set the textDecoration property value to line-through and overline using HTML DOM (JavaScript). html <!DOCTYPE html> <html> <head> <title>HTML DOM Style textDecoration Property</title> </head> <body> <h2>HTML DOM Style textDecoration Property</h2> <p id="GFG"> A Computer science portal for geeks </p> <button onclick="myFunction()"> Set Text Decoration </button> <script> function myFunction() { document.getElementById("GFG").style .textDecoration = "line-through overline"; } </script> </body> </html> Output: Supported BrowsersGoogle Chrome 1 and aboveEdge 12 and aboveInternet Explorer 3 and aboveFirefox 1 and aboveOpera 3.5 and aboveApple Safari 1 and above Comment More infoAdvertise with us B bestharadhakrishna Follow Improve Article Tags : Technical Scripter Web Technologies HTML HTML-DOM Similar Reads HTML | DOM Style fontSizeAdjust Property The fontSizeAdjust property controls better the font size if the first choice of font is not available. It sets or returns the font aspect value of the text. Aspect value is the size difference between the lowercase letter "x" and the uppercase letter "X". Syntax: To set the fontSizeAdjust propertyo 2 min read HTML DOM compareDocumentPosition() Method The DOM compareDocumentPosition() method is used to compare two nodes and it returns an integer describing where they are positioned in the document. Syntax: node1.compareDocumentPosition(node2) Return Value : This return an integer value and their meaning as follows : 1: This means that the two nod 3 min read HTML | DOM touchstart Event The touchstart event is used to execute a script whenever the user touches an HTML element. On touching a particular element, if the touchstart event is associated with it, it can be used to trigger a javascript function. Note: The touchstart event works only on touch screen devices.Supported Tags A 1 min read HTML DOM Image Object The HTML DOM Image object represents an HTML <img> element, allowing for dynamic manipulation of images in the document. This object provides various properties and methods to change image attributes like src, alt, width, height, and more, as well as handling image events such as onload and on 2 min read HTML DOM TransitionEvent propertyName Property The TransitionEvent propertyName property is a read-only property and used for returning the name of the CSS property associated with a transition when a transitionevent occurs. Syntax :event.propertyNameReturn Value: It returns a string representing the transition's name. Example: In this example, 1 min read HTML | DOM Style outlineColor Property The DOM Style outlineColor Property is used to sets or returns the color of the outline around an Element. Syntax: It is used to Return the outlineColor propertyobject.style.outlineColor it is used to Set the outlineColor propertyobject.style.outlineColor = "color|invert|initial|inherit" Property Va 2 min read HTML | DOM touchmove Event The touchmove event is used to execute a script when the user moves the finger across the screen. It works only on touch screen devices and triggers once for every movement and continues to trigger until the finger is released.Supported Tags All HTML elements supported by this event. Syntax: object. 1 min read HTML | DOM Style isolation Property The DOM Style isolation Property defines whether an element must necessarily create a new stacking context. Syntax: Return isolation syntax:object.style.isolationSet isolation syntax:object.style.isolation = "auto|isolate|initial|inherit" Properties: auto: It is the default property value. Using thi 3 min read HTML | DOM TouchEvent metaKey Property The TouchEvent metaKey property is a read-only property and used for returning a Boolean value which indicates whether or not the "meta" key was pressed when a touch event triggered. It mostly returns false because generally, touch devices do not have a meta key. Syntax: event.metaKey Return Value: 2 min read HTML | DOM TouchEvent shiftKey Property The TouchEvent shiftKey property is a read-only property and used for returning a Boolean value which indicates whether or not the "shift" key was pressed when a touch event was triggered. The TouchEvent shiftKey property mostly returns false because generally, touch devices do not have a shift key. 2 min read Like