Javascript examples for CSS Style Property:borderColor
Set the color of the top and bottom border to green, and left and right border to purple, of a <div> element
<!DOCTYPE html> <html> <head> <style> #myDiv {//from w w w . j av a2s. com border: thick solid blue; } </style> </head> <body> <div id="myDiv">This is a div.</div> <br> <button type="button" onclick="myFunction()">Change color of the four borders</button> <script> function myFunction() { document.getElementById("myDiv").style.borderColor = "green purple"; } </script> </body> </html>