How to hide print button while printing?

后端 未结 5 1476
悲&欢浪女
悲&欢浪女 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:31

    You need @media print in you css. Just add this at your bottom ofyour CSS file,

    @media print {
        #print {display: none;}
    }
    

提交回复
热议问题