jQuery
$(function(){
$("#btnPrint").click(function(){
var mydiv = document.getElementById("printDiv");
printDiv(mydiv);
});
});
function printDiv(divP) {
window.frames["print_frame"].document.body.innerHTML = $(divP).html();
window.frames["print_frame"].window.focus();
window.frames["print_frame"].window.print();
}
HTML
<iframe name="print_frame" width="0" height="0" frameborder="0" src="about:blank">
</iframe>
<div id="printDiv">
//some content here
</div>
<input type="button" id="btnPrint" value="Print"/>
The above code is working in IE and Mozilla but not working in Safari,chome and Opera? Please help..