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