borderLeftColor Property - Javascript CSS Style Property

Javascript examples for CSS Style Property:borderLeftColor

Description

The borderLeftColor property sets or gets the left border's color.

Property Values

Value Description
color Set the color of the left border.
transparent The color of the left border is transparent
initial Sets this property to its default value.
inherit Inherits this property from its parent element.

Technical Details

Item Value
Default Value: black
Return Value: A String, representing the color of an element's left border
CSS VersionCSS1

Get the color of the left border of a <div> element

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<div id="myDiv" style="border-left:thick solid green">This is a div element.</div>
<br>
<button type="button" onclick="myFunction()">Return left border color</button>

<script>
function myFunction() {//from  w  w  w.  j  av a 2  s.  c  om
    console.log(document.getElementById("myDiv").style.borderLeftColor);
}
</script>

</body>
</html>

Related Tutorials