HTML | DOM Style borderBottom Property

The DOM style borderBottom property is used to set or returns the three different border-bottom property such as border-bottom-width, border-bottom-style and border-bottom-color of an element.

Syntax:

  • It returns the borderBottom Property.
    object.style.borderBottom
  • It is used to set the borderBottom property.
    object.style.borderBottom = "width style color|initial|inherit"

Return Value: It returns a string value which represent the width, style and/or color of the bottom border of an element.

Example:

filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE html>
<html>
    <head>
        <title>DOM Style borderBottom Property </title>
    </head>
      
    <body>
        <center>
            <h1 style = "color:green;width:50%;" id = "sudo">
                GeeksForGeeks
            </h1>
              
            <h2>DOM Style borderBottom Property </h2>         
            <br>
            <button type = "button" onclick = "geeks()">
                Submit
            </button>
              
            <script>
            function geeks() {
            document.getElementById("sudo").style.borderBottom
                                        = "thick solid green";
            }
            </script>
        </center>
    </body>
</html>                    

chevron_right


Output:
Before Click on the button:

After Click on the button:

Example 2:



filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE html>
<html>
    <head>
        <title>DOM Style borderBottom Property</title>
    </head>
    <body>
        <center>
            <h1 style = "color:green;">
                GeeksForGeeks
            </h1>
              
            <h2>DOM Style borderBottom Property </h2
              
            <h3 style = "border:2px solid red;width:50%;" 
                id = "sudo">geksforgeeks</h3>
            <br>
            <button type = "button" onclick = "geeks()">
                Submit
            </button>
              
            <script>
                function geeks() {
                    document.getElementById("sudo").style.borderBottom
                                            = "thick dotted green";
                }
            </script>
        </center>
    </body>
</html>                    

chevron_right


Output:
Before Click on the button:

After Click on the button:

Supported Browsers: The browser supported by DOM Style borderBottom property are listed below: