Javascript DOM CSS Style borderBottom Property get

Introduction

Return the border-bottom property values of a <div> element:

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

View in separate window

<!DOCTYPE html>
<html>
<body>

<div id="myDiv" style="border-bottom:5px solid red;">This is a div element.</div>
<br>
<button type="button" onclick="myFunction()">Return bottom border</button>
<p id="demo"></p>
<script>
function myFunction() {/*  www .  j a  va  2s  . c  o m*/
  document.getElementById("demo").innerHTML = document.getElementById("myDiv").style.borderBottom;
}
</script>

</body>
</html>



PreviousNext

Related