0 votes
in JavaScript by
How do you print the contents of web page in Javascript?

1 Answer

0 votes
by

The window object provided a print() method which is used to print the contents of the current window. It opens a Print dialog box which lets you choose between various printing options. Let's see the usage of print method in an example,

<input type="button" value="Print" onclick="window.print()" />

Note: In most browsers, it will block while the print dialog is open.

...