Javascript examples for CSS Style Property:outlineColor
The outlineColor property sets or gets the color of the outline around an element.
Value | Description |
---|---|
color | color of the outline. |
invert | Inverts the color of the outline to the opposite value. Default value. |
initial | Sets this property to its default value. |
inherit | Inherits this property from its parent element. |
Item | Value |
---|---|
Default Value: | invert |
Return Value: | A String, representing the color of an element's outline |
CSS Version | CSS2 |
Change the color of the outline of a <div> element:
<!DOCTYPE html> <html> <head> <style> #myDiv {/*from w w w. j a v a2 s. c om*/ border: 1px solid red; outline-style: dotted; } </style> </head> <body> <div id="myDiv" style="outline-color:blue;">This is a div element.</div> <br> <button type="button" onclick="myFunction()">Test</button> <script> function myFunction() { document.getElementById("myDiv").style.outlineColor = 'blue'; } </script> </body> </html>