Javascript DOM CSS Style borderRightStyle Property

Introduction

Add a "solid" right border to a <div> element:

document.getElementById("myDiv").style.borderRightStyle = "solid";

View in separate window

<!DOCTYPE html>
<html>
<body>

<div id="myDiv">This is a div.</div>
<br>
<button type="button" onclick="myFunction()">Set solid right border</button>

<script>
function myFunction() {/*ww w . ja  v  a2s .co m*/
  document.getElementById("myDiv").style.borderRightStyle = "solid";
}
</script>

</body>
</html>

The borderRightStyle property sets or gets the style of the right border of an element.

Property Values

Value Description
noneno border. Default
hidden Same as "none"
dotted a dotted border
dashed a dashed border
solid a solid border
double two borders. The width of the two borders are the same as the border-width value
groove a 3D grooved border.
ridge a 3D ridged border.
inset a 3D inset border.
outset a 3D outset border.
initial Sets this property to its default value.
inherit Inherits this property from its parent element.

The borderRightStyle property returns a String representing the style of an element's right border.




PreviousNext

Related