I'm trying to print an iframe with the code below:
function printFunction() {
window.frames["printf"].focus();
window.frames["printf"].print();
}
<iframe id="printf" name="printf"></iframe>
But the window does not open, and when I use another code:
function printFunction() {
window.print();
}
<iframe id="printf" name="printf"></iframe >
The window opens, but prints the whole page (parent page), and not just the iframe.
Button "print" calls function printFunction()
with onclick.