Hide button after clicking window.print
P粉762447363
P粉762447363 2024-03-29 18:08:19
0
1
380

I need to display: None after clicking the print button. But the print page is opened using the window.open command. So I tried inlining the CSS to print without showing it, but it doesn't work.

This is where I put the inline CSS

<input type="button" style="  @media print{ display: none; }"  id="printPageButton"   
 onclick="   window.print();   "    class="printPageButton noprint" value="Print" >

P粉762447363
P粉762447363

reply all(1)
P粉810050669

Media queries do not exist in inline CSS. You can use CSS @media queries in external CSS files. For example:

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

Content to print

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template