<html>
<body>
<div id="test">
<p>Click the button to get the offsetParent for the test div.</p>
<p><button onclick="myFunction()">Try it</button></p>
<p>offsetParent is: <span id="demo"></span></p>
</div>
<script>
function myFunction() {
var testDiv = document.getElementById("test");
document.getElementById("demo").innerHTML = testDiv.offsetParent;
}
</script>
</body>
<!-- Mirrored from www.w3schools.com/jsref/tryit.asp?filename=tryjsref_prop_element_offsetparent by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 27 Jan 2020 03:02:20 GMT -->
</html>