Answers for "window.print() div"

1

javascript window.print

<button onclick="window.print()">Print this page</button>
Posted by: Guest on May-27-2021
0

window.print a div

@media print {
  body * {
    visibility: hidden;
  }
  #section-to-print, #section-to-print * {
    visibility: visible;
  }
  #section-to-print {
    position: absolute;
    left: 0;
    top: 0;
  }
}
Posted by: Guest on January-15-2021

Browse Popular Code Answers by Language