How do I get the height of the div which includes the clipped area of the div ?
content
conte
Here is one way to achieve what you need, using Fabian idea:
function GetHeight() {
var oDiv = document.getElementById("MyDiv");
var sOriginalOverflow = oDiv.style.overflow;
var sOriginalHeight = oDiv.style.height;
oDiv.style.overflow = "";
oDiv.style.height = "";
var height = oDiv.offsetHeight;
oDiv.style.height = sOriginalHeight;
oDiv.style.overflow = sOriginalOverflow;
alert("Real height is " + height);
}
Live demo and test case: http://jsfiddle.net/yahavbr/7Lbz9/