Set Color of Bottom Border in JavaScript DOM



To set the color of the bottom border in JavaScript, use the borderBottomColor property. It allows you to set the border color for the bottom of a border.

Example

You can try to run the following code to learn how to set the color of the bottom border −

Live Demo

<!DOCTYPE html>
<html>
   <head>
      <style>
         #box {
            border: 2px dashed blue;
            width: 120px;
            height: 120px;
         }
      </style>
   </head>
   <body>
      <button onclick="display()">Set border bottom color</button>
      <div id="box">
         <p>Demo Text</p>
         <p>Demo Text</p>
      </div>
      <script>
         function display() {
            document.getElementById("box").style.borderBottomColor = "yellow";
         }
      </script>
   </body>
</html>
Updated on: 2020-06-23T09:14:25+05:30

847 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements