How should solve the following problem?
The div content changes but height does not change after updating innerHTML by XMLHttpRequest.
This is the main file:
<html>
<head>
<script>
    function loadpage() 
    {   
        var xhttp = new XMLHttpRequest();
        xhttp.onreadystatechange = function() 
        {
            if (this.readyState == 4 && this.status == 200) 
            {
                document.getElementById("mydiv").innerHTML = this.responseText;
            }
        }
        xhttp.open("GET", "page.html", true);
        xhttp.send();
        document.title = document.getElementById("mydiv").clientHeight;
    }
</script>
</head>
<body>
    <div id="mydiv" onclick="loadpage()">hello</div>
</body>
</html>
This is the file page.html
<html>
<body>
1<br>
2<br>
3<br>
4<br>
5<br>
6<br>
7<br>
8<br>
9<br>
10<br>
</body>
</html>
 
     
    