जावास्क्रिप्ट में किसी एलिमेंट के बॉर्डर का रंग सेट करने के लिए, borderColor प्रॉपर्टी का उपयोग करें।
उदाहरण
किसी एलिमेंट के बॉर्डर का रंग सेट करना सीखने के लिए निम्न कोड चलाकर देखें:
<!DOCTYPE html> <html> <head> <style> #box { height: 300px; width: 200px; border: thick dashed yellow; } </style> </head> <body> <div id="box"> <p>DEMO TEXT</p> <p>DEMO TEXT</p> <p>DEMO TEXT</p> <p>DEMO TEXT</p> </div> <br> <button type="button" onclick="display()">बॉर्डर का नया रंग सेट करें</button> <script> function display() { document.getElementById("box").style.borderColor = "green"; } </script> </body> </html>