Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<html>
<head>
    <style>
        body, form{
            margin:0;
        }
        iframe{
            width:100%;
            height:100%;
        }
    </style>
</head>
<body>
<script>
    function createIframe(){
        var body = document.getElementsByTagName('body')[0];
        var iframe = document.createElement("iframe");
        iframe.id="frame";
        body.appendChild(iframe);
        iframe=null;
        body=null;
    }
    function removeIframe(){
        var iframe = document.getElementById('frame');
        var parent = iframe.parentNode;
        parent.removeChild(iframe);
        iframe=null;
    }
</script>
<form onsubmit="event.preventDefault(); return;">
    <button onclick="createIframe()">Create</button>
    <button onclick="removeIframe()">Remove</button>
</form>
</body>
</html>
Output 300px

This bin was created anonymously and its free preview time has expired (learn why). — Get a free unrestricted account

Dismiss x
public
Bin info
anonymouspro
0viewers