borderRight Property - Javascript CSS Style Property

Javascript examples for CSS Style Property:borderRight

Description

The borderRight property sets or gets three border-right properties:

  • border-right-width
  • border-right-style
  • border-right-color

Property Values

Parameter Description
width Sets the width of the right border
style Sets the style of the right border
color Sets the color of the right border
initial Sets this property to its default value.
inherit Inherits this property from its parent element.

Technical Details

Item Value
Default Value: not specified
Return Value: A String, representing the width, style and/or color of the right border of an element
CSS VersionCSS1

Get a right border width of a <div> element

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<div id="myDiv" style="border-right:thick solid red">This is a div element.</div>
<br>
<button type="button" onclick="myFunction()">Return the width of the right border</button>

<script>
function myFunction() {//from  w w w  .  j  a  va2 s.  com
    console.log(document.getElementById("myDiv").style.borderRightWidth);
}
</script>

</body>
</html>

Related Tutorials