x
 
<!DOCTYPE html>
<html>
<body>
<iframe id="myFrame" src="/index.html" height="200" width="300"></iframe>
<p>单击按钮将 iframe 的高度和宽度更改为 400px。</p>
<button onclick="myFunction()">试一试</button>
<script>
function myFunction() {
  document.getElementById("myFrame").height = "400";
  document.getElementById("myFrame").width = "400";
}
</script>
</body>
</html>