打印整個頁面
示例1.
可直接在按鈕添加調用打印方法:
<input type='button' value='打印整頁' onclick='javascript:window.print();' />
示例2.
也可調用JS方法
<html><head><script type="text/javascript">function printpage() { window.print() }</script></head><body><input type="button" value="Print this page"onclick="printpage()" /></body></html>
關于window.print()方法
print() 方法用于打印當前窗口的內容。
以上就是本文的全部內容,希望本文的內容對大家的學習或者工作能帶來一定的幫助,同時也希望多多支持武林網!
新聞熱點
疑難解答