首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >html打印选项,隐藏打印按钮

html打印选项,隐藏打印按钮
EN

Stack Overflow用户
提问于 2017-01-19 12:24:12
回答 1查看 1.4K关注 0票数 0

我不想要打印按钮在打印时在硬拷贝。

代码语言:javascript
复制
<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>

此外,如果有网站解释如何正确使用打印某一页某一节的硬拷贝,也请提供参考。谢谢。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-01-19 12:27:47

隐藏打印button

this.style.display='none';

在印刷之前。

代码语言:javascript
复制
<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>

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/41741759

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档