JSFiddle - React, Tailwind, and code Playground
by dying_sakura
HTML
<article class="first">
<h1>File 1</h1>
<button class="expandtest">Print File</button>
<iframe id="iframeOne" src="http://fiddle.jshell.net/FQpd7/4/show/"></iframe>
</article>
CSS
iframe{
height: 40px;
border: dotted 2px #555;
overflow-x: hidden;
overflow-y: hidden;
display: block;
width: 60%;
margin: auto;
}
JavaScript
$(document).ready(function() {
iframeHeight =
document.getElementById("iframeOne").contentWindow.document.body.clientHeight;
$('.expandtest').click(function () {
$(this).siblings('iframe')[0].contentWindow.print();
});
});