JavaScript – Change the Border Width of Div

To change the border width of a div using JavaScript, get reference to the element, and assign required width value to the element.style.borderWidth property.

Example

Conclusion

In this JavaScript Tutorial, we learned how to change the border width of a div using JavaScript.