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