Javascript DOM CSS Style borderLeftStyle Property get

Introduction

Return the left border style of a <div> element:

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

View in separate window

<!DOCTYPE html>
<html>
<body>

<div id="myDiv" style="border-left:double;">This is a div.</div>
<br>
<button type="button" onclick="myFunction()">Return left border style</button>

<p id="demo"></p>
<script>
function myFunction() {//www .  j av a 2s  .  c o  m
  document.getElementById("demo").innerHTML = document.getElementById("myDiv").style.borderLeftStyle;
}
</script>

</body>
</html>



PreviousNext

Related