So I have a iFrame that is linked to a out sourced quote on another website. Is it possible to add a print button for the results inside that iFrame?
I have the following code attempt but it's not doing much at all - When the button is clicked, it does nothing
<iframe src="https://www.compulife.net/website/1295/quoter.html" width="750 pixels" id="test" name="test" height="750 pixels" frameborder="0" formtarget="_blank"></iframe>
<input type="button" value="Print" onclick="test()" />
<script>
function test {
window.frames["test"].focus();
window.frames["test"].print();
}
</script>
Error:
Uncaught TypeError: test is not a function
at HTMLInputElement.onclick
Is there something that I might be doing wrong?