The borderBottomColor
property sets
or gets the the bottom border's color from an element.
borderBottomColor |
Yes | Yes | Yes | Yes | Yes |
Return the borderBottomColor property:
var v = object.style.borderBottomColor
Set the borderBottomColor property:
object.style.borderBottomColor='color|transparent|initial|inherit'
Value | Description |
---|---|
color | Set the color for the bottom border. Default color is black |
transparent | Set color of the bottom border to transparent |
initial | Sets this property to its default value. |
inherit | Inherits this property from its parent element. |
Default Value: | black |
---|---|
Return Value: | A string value for the an element's bottom border's color |
CSS Version | CSS1 |
The following code shows how to change the bottom border's color.
<!DOCTYPE html>
<html>
<head>
<style>
#myDiv {<!--from ww w . j a v a 2 s.c o m-->
border: thick solid blue;
}
</style>
</head>
<body>
<div id="myDiv">This is a div.</div>
<button type="button" onclick="myFunction()">test</button>
<script>
function myFunction() {
document.getElementById("myDiv").style.borderBottomColor = "black";
}
</script>
</body>
</html>
The code above is rendered as follows:
The following code shows how to get the bottom border's color.
<!DOCTYPE html>
<html>
<body>
<div id="myDiv" style="border-bottom:thick solid green">This is a div.</div>
<button type="button" onclick="myFunction()">test</button>
<p>Check the Javascript console windows for the result.</p>
<script>
function myFunction() {<!-- w w w . j a v a 2 s .co m-->
console.log(document.getElementById("myDiv").style.borderBottomColor);
}
</script>
</body>
</html>
The code above is rendered as follows: