x
 
<!DOCTYPE html>
<html>
<body>
<iframe id="myframe" src="/index.html" height="250" width="450">
<p>您的浏览器并不支持 iframe。</p>
</iframe>
<p>单击按钮以显示 iframe 的高度。</p>
<button onclick="myFunction()">试一试</button>
<p id="demo"></p>
<script>
function myFunction() {
  var x = document.getElementById("myframe").height;
  document.getElementById("demo").innerHTML = x;
}
</script>
</body>
</html>