SOURCE

console 命令行工具 X clear

                    
>
console
function myFunction() {
    var elmnt = document.getElementById("myDIV");
    var txt = "Border top width: " + elmnt.clientTop + "px<br>";
    txt += "scrollTop: " + elmnt.scrollTop + "px<br>";
    txt += "offsetTop: " + elmnt.offsetTop + "px<br>";
    document.getElementById("demo").innerHTML = txt;
}
<button onclick="myFunction()">Try it</button>

<div id="myDIV">
  <p id="demo"></p>
</div>
#myDIV {
    height: 250px;
    width: 400px;
    padding: 10px;
    margin: 15px;
    border-top: 15px solid black;
    border-left: 10px solid red;
    background-color: lightblue;
}