window.addEventListener("resize", getSize);
function getSize(){
var node = document.getElementById('sample');
var height = node.style.height;
console.log('height: ', height);//expect 100px, get nothing
}
#sample {
padding: 20px;
height: 100px;
overflow-y: auto;
border: solid blue;
margin: 10px 300px 10px 25px;
position: 'relative'
}
node.style.height
is always empty/null. Note that I set the height to 100px. Why? How can I get the css height of the node?