HTML | DOM Style borderRight Property
The DOM style borderRight property is used to set or returns the three different border-right property such as border-right-width, border-right-style and border-right-color of an element.
Syntax:
- It returns the borderRight Property.
object.style.borderRight
- It is used to set the borderRight property.
object.style.borderRight = "width style color|initial|inherit"
Return Value: This property returns a string which represents the width, style and color of the right border of an element.
Example 1:
<!DOCTYPE html> <html> <head> <title>DOM Style borderRight Property </title> </head> <body> <center> <h1 style = "color:green;width:50%;" id = "sudo"> GeeksForGeeks </h1> <h2>DOM Style borderRight Property </h2> <br> <button type = "button" onclick = "geeks()"> Submit </button> <script> function geeks() { document.getElementById("sudo").style.borderRight = "thick solid green"; } </script> </center> </body> </html> |
Output:
Before Click on the button:

After Click on the button:

Example 2:
<!DOCTYPE html> <html> <head> <title>DOM Style borderRight Property</title> </head> <body> <center> <h1 style = "color:green;"> GeeksForGeeks </h1> <h2>DOM Style borderRight Property </h2> <h3 style = "border:2px solid red;width:50%;" id = "sudo">geksforgeeks</h3> <br> <button type = "button" onclick = "geeks()"> Submit </button> <script> function geeks() { document.getElementById("sudo").style.borderRight = "thick dotted green"; } </script> </center> </body> </html> |
Output:
Before Click on the button:

After Click on the button:

Supported Browsers: The browser supported by DOM borderRight property are listed below:
- Apple Safari
- Google Chrome
- Firefox
- Opera
- Internet Explorer
Recommended Posts:
- HTML | DOM Style top Property
- HTML | DOM Style right Property
- HTML | DOM Style alignContent Property
- HTML | DOM Style emptyCells Property
- HTML | DOM Style border Property
- HTML | DOM Style borderRightColor Property
- HTML | DOM Style zIndex Property
- HTML | DOM Style borderTopColor Property
- HTML | DOM Style fontWeight Property
- HTML | DOM Style perspective Property
- HTML | DOM Style letterSpacing Property
- HTML | DOM Style outlineColor Property
- HTML | DOM Style alignItems Property
- HTML | DOM Style borderWidth Property
- HTML | DOM Style left Property
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.



