Opening different iframe depending on different button click

Got it. Offsetheight. That’s weird

<!doctype html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<style type="text/css">
  p {width:88%; margin:2em auto;}
  #video {float:left; margin: 1em 1em 0 0; background-color:#fdd;
          width:500px; height:500px;line-height:185px; text-align:center;}
  h4     {margin:0; padding:0;}
</style>
<title>Javascript calling iFrame</title>
</head>
<body>
<div style="float:left; width:15em; height:240px; margin:1em 1em 0 0; background-color:#dff;">
  <p><a href="#" onmousedown="sitepoint()">
  	SitePoint</a></p> 

</div>

<div id="video">
</div>
<script>
function sitepoint() {
   ifrm = document.createElement("IFRAME");
   ifrm.setAttribute("src", "http://sitepoint.com/");
   ifrm.style.width = document.getElementById("video").offsetWidth+"px";
   ifrm.style.height = document.getElementById("video").offsetHeight+"px";
   document.getElementById("video").appendChild(ifrm);
} 

</script>
</body>
</html>

Edit-John, the append child I mentioned did work for me. As seen in my above code. Not sure why it wasn’t working for you…