function contentPrint(contentArea) {
var initBody = document.body.innerHTML;
if ($("div").hasClass("scroll")) {
$(".scroll").attr("class", "");
}
if (window.matchMedia) {
var mediaQueryList = window.matchMedia('print');
mediaQueryList.addListener(function (mql) {
if (mql.matches) {
document.body.innerHTML = document.getElementById(contentArea).innerHTML;
} else {
document.body.innerHTML = initBody;
}
});
}
window.onbeforeprint = function () {
document.body.innerHTML = document.getElementById(contentArea).innerHTML;
}
window.onafterprint = function () {
document.body.innerHTML = initBody;
}
window.print();
}
<p style="page-break-before: always;"></p>
<br style="height: 0; line-height: 0" />