Write this function in javascript tag and call in your page. Here "printingstuff" is a div tag.
function printDiv()
{
var printer = window.open('','','width=640,height=700');
printer.document.open("text/html");
printer.document.write(document.getElementById('printingstuff').innerHTML);
printer.document.close();
printer.window.close();
printer.print();
alert("Printing the \"printingstuff\" div...");
}
No comments:
Post a Comment