How to print the full webpage using JavaScript?

Published March 7, 2021

To take a printout of the full webpage in JavaScript, you can use the print() method in the global window object.

// Print full webpage 🖨
window.print();
  • Invoking the window.print() method will open the print dialog to print the full webpage.

See the working code on JSBin

Feel free to share if you found this useful 😃.


Share on: Facebook Twitter