JSFiddle - React, Tailwind, and code Playground

HTML

<a href="#" id="createiframe">Click Here to Create iFrame</a>

<div id="iframecontainer"></div>

CSS

#iframecontainer {
    text-align: center;
}

JavaScript

$('#createiframe').click(function(){
    var iframe = document.createElement("iframe");
    var w = 500;
    var h = 300;
    iframe.src = 'http://www.google.com';
    iframe.style.width = w+'px';
    iframe.style.height= h+'px';
    iframe.style.border= "5px";
    iframe.style.margin= "0";
    iframe.setAttribute("scrolling","yes");
    iframe.setAttribute("id","googleiframe");
    /*
    document.body.insertBefore(iframe, document.body.firstChild);
    */
    $('#iframecontainer').append(iframe);
});