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