问题描述
我要在使用javascript打印命令时从页眉和页脚中删除url和页码,以便我只能打印特定的div内容.
我已经使用了这个javascript函数
:
< script language ="javascript">
函数printDiv(divName){
var printContents = document.getElementById(divName).innerHTML;
var originalContents = document.body.innerHTML;
document.body.innerHTML = printContents;
window.print();
document.body.innerHTML = originalContents;
}
</script>
谢谢
I want to remove url and page number from header and footer while i am using javascript print command so that i can only print particular div content .
I have use this javascript function
:
<script language="javascript">
function printDiv(divName) {
var printContents = document.getElementById(divName).innerHTML;
var originalContents = document.body.innerHTML;
document.body.innerHTML = printContents;
window.print();
document.body.innerHTML = originalContents;
}
</script>
Thanks
推荐答案
这篇关于如何使用打印按钮从页眉和页脚中删除url和页码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!