Style borderLeftStyle attribute

Definition and Usage

borderLeftStyle Sets or returns the style of the element's left border.

See also:

CSS Tutorial:CSS Borders

CSS Reference Manual:border-left-style attribute

HTML DOM Reference Manual:border attribute

Example

Example 1

Adds a solid left border to the <div> element:

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

Try It Yourself

Example 2

Changes the left border style of the <div> element to "dotted":

document.getElementById("myDiv").style.borderLeftStyle = "dotted";

Try It Yourself

Example 3

Returns the left border style of the <div> element:

alert(document.getElementById("myDiv").style.borderLeftStyle);

Try It Yourself

Example 4

Demonstration of all different values:

var listValue = selectTag.options[selectTag.selectedIndex].text;
document.getElementById("myDiv").style.borderLeftStyle = listValue;

Try It Yourself

Syntax

Returns the borderLeftStyle property:

object.style.borderLeftStyle

Sets the borderLeftStyle property:

object.style.borderLeftStyle = value
Value Description
none Defines a border without any borders. Default.
hidden Same as "none", except in resolving border conflicts of table elements.
dotted Defines a dotted border.
dashed Defines a dashed border.
solid Defines a solid border.
double Defines two borders. The width of both borders is the same as the value of border-width.
groove Defines a 3D groove border. The effect depends on border-color the value.
ridge Defines a 3D ridge border. The effect depends on border-color the value.
inset Defines a 3D inset border. The effect depends on border-color the value.
outset Defines a 3D outset border. The effect depends on border-color the value.
initial Sets this property to its default value. See initial.
inherit Inherits this property from its parent element. See inherit.

Technical Details

Default value: none
Return value: A string representing the style of the element's left border.
CSS Version: CSS1

Browser Support

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Support Support Support Support Support