- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
HTML DOM Style borderLeftWidth Property
The HTML DOM borderLeftWidth property is used for setting or getting the Left border width for an element.
Following is the syntax for −
Setting the borderLeftWidth property −
object.style.borderLeftWidth = "thin|medium|thick|length|initial|inherit"
The property values are explained as follows −
Value | Description |
---|---|
thin | This specifies a thin border. |
medium | This specifies the medium border and is the default value. |
thick | This specifies a thin border. |
length | For setting this property to default value. |
initial | For setting this property to initial value. |
inherit | To inherit the parent property value |
Let us look at an example for the borderLeftWidth Property −
Example
<!DOCTYPE html> <html> <head> <style> #DIV1{ height: 100px; width: 200px; border: 10px groove orange; padding: 10px; border-Left-width:30px; } </style> <script> function changeLeftWidth(){ document.getElementById("DIV1").style.borderLeftWidth="1px"; document.getElementById("Sample").innerHTML="The Left border width is now decreased"; } </script> </head> <body> <div id="DIV1">SOME SAMPLE TEXT</div> <p>Change the above div Left border width by clicking the below button</p> <button onclick="changeLeftWidth()">Change Left Width</button> <p id="Sample"></p> </body> </html>
Output
On clicking the “Change Left Width” button −
Advertisements