HTML | DOM Style textShadow Property Last Updated : 05 Aug, 2022 Comments Improve Suggest changes Like Article Like Report The style textShadow property in HTML DOM is used to set the shadow effects for text. We can set more than one shadow effects by using this property. This property can also return the shadow effects of a text. Syntax: It returns the textShadow property.object.style.textShadowIt used to set the textShadow property.object.style.textShadow = "none|h-shadow v-shadow blur color| initial|inherit" Property Values: none: This property makes no shadow is drawn.This is a default value.h-shadow: This is used to position the horizontal shadow and it allows negative values. This is a mandatory fieldv-shadow: This is used to position the vertical shadow and it allows negative values. This is a mandatory field.blur: It is an optional one and it specifies the blur distance.color: It is an optional one and is used to specify the color for a shadow.initial: It sets the textShadow property to its default value.inherit: This property is inherited from its parent element. Return Value: It returns string that represents a comma separated list of shadow effects of textShadow property of a element. Example 1: HTML <!DOCTYPE html> <html> <head> <title>DOM Style textShadow Property </title> <style> </style> </head> <body> <center> <h1 style="color:green;width:40%;"> GeeksForGeeks </h1> <h2>DOM Style textShadow Property </h2> <p id="gfg"> A Computer science portal for geeks </p> <button type="button" onclick="geeks()"> Change Style </button> <script> function geeks() { // Set textShadow in green color. document.getElementById( "gfg").style.textShadow = "5px 5px 1px green"; } </script> </center> </body> </html> Output: Before Click on the button: After Click on the button: Example 2: HTML <!DOCTYPE html> <html> <head> <title>DOM Style textShadow Property </title> <style> </style> </head> <body> <center> <h1 style="color:green;width:40%;"> GeeksForGeeks </h1> <h2>DOM Style textShadow Property </h2> <p id="gfg"> A Computer science portal for geeks </p> <button type="button" onclick="geeks()"> Shadow effect </button> <script> function geeks() { // Set textShadow in magenta color. document.getElementById( "gfg").style.textShadow = "-3px -5px 1px magenta"; } </script> </center> </body> </html> Output: Before Click on the button: After Click on the button: Supported Browsers: The browser supported by DOM Style textShadow property are listed below: Google Chrome 2Edge 12Internet Explorer 10Firefox 3.5Opera 9.5Safari 1.1 Create Quiz Comment B bestharadhakrishna Follow 0 Improve B bestharadhakrishna Follow 0 Improve Article Tags : Web Technologies HTML HTML-DOM HTML-Property Explore HTML BasicsHTML Introduction4 min readHTML Editors4 min readHTML Basics7 min readStructure & ElementsHTML Elements4 min readHTML Attributes7 min readHTML Headings3 min readHTML Paragraphs3 min readHTML Text Formatting4 min readHTML Block and Inline Elements3 min readHTML Charsets4 min readListsHTML Lists3 min readHTML Ordered Lists5 min readHTML Unordered Lists4 min readHTML Description Lists3 min readVisuals & MediaHTML Colors11 min readHTML Links Hyperlinks2 min readHTML Images7 min readHTML Favicon4 min readHTML Video4 min readLayouts & DesignsHTML Tables9 min readHTML Iframes4 min readHTML Layout4 min readHTML File Paths3 min readProjects & Advanced TopicsHTML Forms5 min readHTML5 Semantics5 min readHTML URL Encoding4 min readHTML Responsive Web Design11 min readTop 10 Projects For Beginners To Practice HTML and CSS Skills8 min readTutorial ReferencesHTML Tags - A to Z List15+ min readHTML Attributes Complete Reference8 min readHTML Global Attributes5 min readHTML5 Complete Reference8 min readHTML5 MathML Complete Reference3 min readHTML DOM Complete Reference15+ min readHTML DOM Audio/Video Complete Reference2 min readSVG Element Complete Reference5 min readSVG Attribute Complete Reference8 min readSVG Property Complete Reference7 min readHTML Canvas Complete Reference4 min read Like