代码如下:
function preview() {
bdhtml = window.document.body.innerHTML;
sprnstr = " ";
eprnstr = " ";
prnhtml = bdhtml.substr(bdhtml.indexOf(sprnstr) + 10);
prnhtml = prnhtml.substring(0, prnhtml.indexOf(eprnstr));
window.document.body.innerHTML = prnhtml;
window.print();
}
上面的是javascript代码,下面是html页面代码
复制代码代码如下:
课程表查询结果
要打印的内容放在这里