1// window.getComputedStyle(<element>).<css-attribute>
2// example :
3window.getComputedStyle(document.getElementById("11")).width
1let box = document.querySelector('.box');
2let style = getComputedStyle(box);
3
4let borderTopWidth = parseInt(style.borderTopWidth) || 0;
5let borderLeftWidth = parseInt(style.borderLeftWidth) || 0;
6let borderBottomWidth = parseInt(style.borderBottomWidth) || 0;
7let borderRightWidth = parseInt(style.borderRightWidth) || 0;
8Code language: JavaScript (javascript)