打印整個(gè)頁面
示例1.
可直接在按鈕添加調(diào)用打印方法:
<input type='button' value='打印整頁' onclick='javascript:window.print();' />
示例2.
也可調(diào)用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>關(guān)于window.print()方法
print() 方法用于打印當(dāng)前窗口的內(nèi)容。
以上就是本文的全部?jī)?nèi)容,希望本文的內(nèi)容對(duì)大家的學(xué)習(xí)或者工作能帶來一定的幫助,同時(shí)也希望多多支持武林網(wǎng)!
新聞熱點(diǎn)
疑難解答
圖片精選
網(wǎng)友關(guān)注