【问题标题】:html print option , hide print button [duplicate]html打印选项,隐藏打印按钮[重复]
【发布时间】:2017-06-04 03:36:19
【问题描述】:

打印时我不希望硬拷贝中的打印按钮。

<html>
    <head>
     <title>New Page 1</title>

    </head>
    <body>
     <p>
        This is just a paragraph fellas. I do not want the print button in the hard copy.
     </p>
    <input type="button" value="print" onclick="window.print()" />
    </body>
</html>

此外,如果有一个网站解释了如何正确使用如何打印页面特定部分的硬拷贝,请同时提供参考。谢谢。

【问题讨论】:

    标签: html css


    【解决方案1】:

    隐藏打印button

    this.style.display='none';

    打印前。

    <html>
        <head>
         <title>New Page 1</title>
    
        </head>
        <body>
         <p>
            This is just a paragraph fellas. I do not want the print button in the hard copy.
         </p>
        <input type="button" value="print" onclick="this.style.display='none';window.print();" />
        </body>
    </html>

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-11-10
      • 2021-12-11
      • 2012-08-26
      • 2018-07-04
      • 2021-11-04
      相关资源
      最近更新 更多