JSFiddle - React, Tailwind, and code Playground
HTML
<ul>
<li>
<a href="http://www.google.com/" onclick="return loadIframe('ifrm', this.href);">Page 1</a>
</li>
<li>
<a href="http://www.apple.com/" onclick="return loadIframe('ifrm', this.href);">Page 2</a>
</li>
</ul>
<div class="iframe">
<iframe name="ifrm" id="ifrm" src="http://www.microsoft.com/" frameborder="0">
Your browser doesn't support iframes.
</iframe>
</div>
JavaScript
function loadIframe(iframeName, url) {
var $iframe = $('#' + iframeName);
if ( $iframe.length ) {
$iframe.attr('src',url);
return false;
}
return true;
}