Javascript examples for CSS Style Property:borderLeft
The borderLeft property sets or gets three border-left properties.
Parameter | Description |
---|---|
width | Sets the width of the left border |
style | Sets the style of the left border |
color | Sets the color of the left border |
initial | Sets this property to its default value. |
inherit | Inherits this property from its parent element. |
Item | Value |
---|---|
Default Value: | not specified |
Return Value: | A String, representing the width, style and/or color of the left border of an element |
CSS Version | CSS1 |
Get a left border of a <div> element:
<!DOCTYPE html> <html> <body> <div id="myDiv" style="border-left:thick solid red">This is a div element.</div> <br> <button type="button" onclick="myFunction()">Return the width of the left border</button> <script> function myFunction() {/* w ww .ja v a 2s.c o m*/ console.log(document.getElementById("myDiv").style.borderLeftWidth); } </script> </body> </html>