HTML | DOM Style outlineStyle Property
The Style outlineStyle property in HTML DOM is used to set or return the style of the outline around an element.
Syntax:
object.style.outlineStyle
object.style.outlineStyle = value
:
Property Values:
Return Value: This method returns a String value representing the style of an element’s outline.
Example 1:
<!DOCTYPE html> <html> <head> <title> HTML | DOM Style outlineStyle Property </title> <style> #myDiv { border: 1px solid red; outline: green dotted thick; } </style> </head> <body> <h1> Geeks for Geeks</h1> <h2>HTML | DOM Style outlineStyle Property</h2> <div id="myDiv">Welcome to Geeks for Geeks.</div> <br> <button type="button" onclick="myFunction()"> Click Here! </button> <script> function myFunction() { document.getElementById("myDiv") .style.outlineStyle = "solid"; } </script> </body> </html> |
chevron_right
filter_none
Output:
- Before click on the button:
- After click on the button:
Example 2:
<!DOCTYPE html> <html> <head> <title> HTML | DOM Style outlineStyle Property </title> <style> #myDiv { border: 1px solid red; } </style> </head> <body> <h1> HTML | DOM Style outlineStyle Property</h1> <div id="myDiv">Welcome to Geeks for Geeks.</div> <br> <button type="button" onclick="myFunction()"> Click Here! </button> <script> function myFunction() { document.getElementById("myDiv") .style.outlineStyle = "dotted"; } </script> </body> </html> |
chevron_right
filter_none
Output:
- Before click on the button:
- After click on the button:
Supported Browsers: The browser supported by DOM Style outlineStyle Property are listed below:
- Google Chrome
- Internet Explorer
- Firefox
- Opera
- Safari
Recommended Posts:
- HTML | DOM Style top Property
- HTML | DOM Style right Property
- HTML | DOM Style outlineOffset Property
- HTML | DOM Style visibility Property
- HTML | DOM Style textIndent Property
- HTML | DOM Style transitionDelay Property
- HTML | DOM Style paddingLeft Property
- HTML | DOM Style columnRuleColor Property
- HTML | DOM Style minWidth Property
- HTML | DOM Style transformOrigin Property
- HTML | DOM Style transition Property
- HTML | DOM Style userSelect Property
- HTML | DOM Style textShadow Property
- HTML | DOM Style animationTimingFunction Property
- HTML | DOM Style fontSizeAdjust Property
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.



