Javascript DOM CSS Style borderStyle Property get

Introduction

Return the border style of a <div> element:

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

View in separate window

<!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>

<p id="demo"></p>
<script>
function myFunction() {/*w ww  . j a  v a  2s .c o  m*/
  document.getElementById("demo").innerHTML = document.getElementById("myDiv").style.borderStyle;
}
</script>

</body>
</html>



PreviousNext

Related