How to hide print button while printing?

后端 未结 5 1492
悲&欢浪女
悲&欢浪女 2021-01-23 05:57

I want to print the page on button click without opening a new tab.

I have a following lines of code that does the job for me.

function PrintDiv() {    
         


        
5条回答
  •  心在旅途
    2021-01-23 06:54

    You need to have a print based CSS style rule - you can also set other print based rules - such as document size, background color , image specs etc:

    @media print {
       #button-container{
          display: none;
       }
    }
    

提交回复
热议问题