How to hide print button while printing?

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

    Hi you can use below methods,

    $('#PrintDiv').hide();
    

    or

    $('#PrintDiv').prop('disabled', 'true');
    

    or

     @media print{
        #PrintDiv{
            display:none !important;
        }
    }
    

提交回复
热议问题