Thursday, 29 January 2015

How to print DIV contents only



function printdiv(printpage)
{
var headstr = "";
var footstr = "
";var newstr = document.all.item(printpage).innerHTML;
var oldstr = document.body.innerHTML;
document.body.innerHTML = headstr+newstr+footstr;
window.print();
document.body.innerHTML = oldstr;
return false;
}










The Div content which you want to print






Ref: http://forums.asp.net/t/1261525.aspx?How+to+print+DIV+contents+only