หากต้องการตั้งค่าความกว้างของเส้นขอบด้านล่าง ให้ใช้คุณสมบัติ borderBottomWidth ใน JavaScript คุณสมบัตินี้ช่วยให้คุณเปลี่ยนความกว้างได้
ตัวอย่าง
คุณสามารถลองรันโค้ดต่อไปนี้เพื่อเรียนรู้วิธีตั้งค่าความกว้างของเส้นขอบด้านล่าง −
<!DOCTYPE html> <html> <body> <div id="box">Demo Text</div> <br> <button onclick="display()">Click to set width of bottom border</button> <script> function display() { document.getElementById("box").style.borderBottomStyle = "dashed"; document.getElementById("box").style.borderBottomWidth = "5px"; } </script> </body> </html>