How to print the full webpage using JavaScript?

March 7, 2021 - 1 min read

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 😃.