heres a rather dirty way of doing it
Code:
<html>
<body>
<iframe id=adframe src="#" width=600 height=200></iframe>
<button onclick=adframe.document.getElementById('stuff').innerHTML=s1>Change html 1</button><br>
<button onclick=adframe.document.getElementById('stuff').innerHTML=s2>Change html 2</button><br>
<script type="text/javascript">
var s1 = "<a href=https://gfy.com>gfy</a>";
var s2 = "<a href=http://ytmnd.webspacemania.com/htyt/>htyt</a>";
adframe.document.write("<div id=stuff></div>");
</script>
</body>
</html>
what you are doing is basically setting a blank iframe , adding a div called stuff to it, then injecting the html with script