DEV Community

Cover image for How to print the full webpage using JavaScript?
MELVIN GEORGE
MELVIN GEORGE

Posted on • Originally published at melvingeorge.me

How to print the full webpage using JavaScript?

Originally posted here!

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();
Enter fullscreen mode Exit fullscreen mode
  • 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 😃.


Top comments (0)