Javascript examples for CSS Style Property:borderStyle
The borderStyle property sets or gets the style of an element's border.
This property can take from one to four values:
Value | Description |
---|---|
none | No border will be displayed. |
hidden | Same as 'none' |
dotted | a series of dots. |
dashed | a series of short line segments i.e. dashes. |
solid | a single solid line. |
double | a two parallel solid lines. |
groove | Looks like carved into the canvas. |
ridge | opposite effect of 'groove'. |
inset | Looks like embedded in the canvas. |
outset | opposite effect of 'inset'. |
initial | Sets this property to its default value. |
inherit | takes the computed value of its parent element border-bottom-style property. |
Item | Value |
---|---|
Default Value: | none |
Return Value: | A String, representing the style of an element's border |
CSS Version | CSS1 |
Get border to a <div> element:
<!DOCTYPE html> <html> <body> <div id="myDiv" style="border-style:groove dotted;">This is a div.</div> <br> <button type="button" onclick="myFunction()">Return border style</button> <script> function myFunction() {//w w w . ja va 2s. c o m console.log(document.getElementById("myDiv").style.borderStyle); } </script> </body> </html>