Javascript examples for Browser Object Model:Window print
The print() method prints the contents of the current windowby opening the Print Dialog Box, which lets the user to select preferred printing options.
None
No return value
The following code shows how to Print the current page:
<!DOCTYPE html> <html> <body> <button onclick="myFunction()">Print this page</button> <script> function myFunction() {/* ww w.ja v a2 s . c om*/ window.print(); } </script> </body> </html>