Javascript DOM CSS Style borderBottomStyle Property set

Introduction

Change the style of the bottom border of a <div> element to "dotted":

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

View in separate window

<!DOCTYPE html>
<html>
<head>
<style>
#myDiv {/*ww w. ja  v  a  2 s. c o m*/
  border: thick solid #FF0000;
}
</style>
</head>
<body>

<div id="myDiv">This is a div.</div>
<br>
<button type="button" onclick="myFunction()">Change style of the bottom border</button>

<script>
function myFunction() {
  document.getElementById("myDiv").style.borderBottomStyle = "dotted";
}
</script>

</body>
</html>



PreviousNext

Related