js的window.print打印页面 不打印网页中的“打印”按钮

xiaoxiao2021-02-28  50

设置样式来控制不打印“打印”按钮:

<style type="text/css" media="print"> .noprint { display:none;} </style>

然后把它应用到 “打印”按钮上:

<input type="button" name="button" id="button" value="打印" class="noprint" />

这样可以实现 在页面展示的时候有“打印”按钮,但是在打印的时候不打印“打印”这个按钮。 同理,此方法可以运用于其他不想打印的按钮等。

转载请注明原文地址: https://www.6miu.com/read-72096.html

最新回复(0)