JSFiddle - React, Tailwind, and code Playground

HTML

<div class="loadiframe">
    <button id="b1" data-src="http://jquery.com/" data-width="500" data-height="400">Button 1</button>
    <button id="b2" data-src="http://sitepoint.com" data-width="650" data-height="350">Button 2</button>
</div>
<iframe id='frame' frameborder="0" scrolling="no" width="500" height="400">

JavaScript

function iframeChange() {
    var buttons = document.querySelector(".loadiframe"),
        iframe = document.getElementById('frame');

    buttons.addEventListener("click", function (e) {
        iframe.src = e.target.dataset.src;
        iframe.width = e.target.dataset.width;
        iframe.height = e.target.dataset.height;
    });
}
window.onload = iframeChange;