HTML | DOM Style borderLeft Property
The DOM style borderLeft property is used to set or returns the three different border-Left property such as border-left-width, border-left-style and border-left-color of an element.
Syntax:
- It is used to return the borderLeft Property.
object.style.borderLeft
- It is used to set the borderLeft property.
object.style.borderLeft = "width style color|initial|inherit"
Return Value: It returns a string value which represents the width, style and/or color of the left border of an element.
Example 1:
<!DOCTYPE html> <html> <head> <title> DOM Style borderLeft Property </title> </head> <body> <center> <h1 style = "color:green;width:50%;" id = "sudo"> GeeksForGeeks </h1> <h2>DOM Style borderLeft Property </h2><br> <button type = "button" onclick = "geeks()"> Submit </button> <script> function geeks() { document.getElementById("sudo").style.borderLeft = "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 borderLeft Property </title> </head> <body> <center> <h1 style = "color:green;"> GeeksForGeeks </h1> <h2>DOM Style borderLeft 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.borderLeft = "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 borderLeft Property are listed below:
- Apple Safari
- Google Chrome
- Firefox
- Opera
- Internet Explorer
Recommended Posts:
- HTML | DOM Style right Property
- HTML | DOM Style top Property
- HTML | DOM Style borderBottomColor Property
- HTML | DOM Style transition Property
- HTML | DOM Style transformOrigin Property
- HTML | DOM Style overflowY Property
- HTML | DOM Style userSelect Property
- HTML DOM | Style pageBreakBefore Property
- HTML | DOM Style width Property
- HTML DOM | Style paddingRight Property
- HTML | DOM Style listStyleType Property
- HTML DOM | Style pageBreakInside Property
- HTML | DOM Style paddingTop Property
- HTML | DOM Style paddingBottom Property
- HTML DOM | Style paddingLeft 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.



