किसी एलिमेंट की चौड़ाई सेट करने के लिए जावास्क्रिप्ट में width प्रॉपर्टी का उपयोग करें।
उदाहरण
जावास्क्रिप्ट में किसी एलिमेंट की चौड़ाई सेट करना सीखने के लिए निम्न कोड चलाकर देखें:
<!DOCTYPE html> <html> <body> <button type="button" id="btn" onclick="display()"> ऊंचाई और चौड़ाई बदलें </button> <script> function display() { document.getElementById("btn").style.width = "250px"; document.getElementById("btn").style.height = "250px"; } </script> </body> </html>