clientTop property
The property clientTop contains
the width of the top border
(border-top
value).
Syntax
javascriptelement.clientTop;
Example
Let's find out the width of the top border of an element:
html<div id="elem"></div>css#elem {
width: 100px;
height: 100px;
border: 10px solid black;
}javascriptlet elem = document.querySelector('#elem');
console.log(elem.clientTop);
The code execution result:
javascript10
See also
-
the
clientLeftproperty
that contains the width of the left border