print method (window)
Prints the contents of the current window.
Use the media at-rule to customize the appearance of the printed pages and the print preview.
If you want to print the contents of a frame or iframe element, use the print method on the window object of the frame (see the contentWindow property).
If you want to print the contents of a frame or iframe element, use the print method on the window object of the frame (see the contentWindow property).
Syntax:
You can find the related objects in the Supported by objects section below.
Return value:
This method has no return value.
Example HTML code 1:
This example illustrates the use of the print method:
|
||||
<head> <script type="text/javascript"> function PrintDocument () { window.print (); } </script> </head> <body> <button onclick="PrintDocument ();">Print the entire document!</button> </body> |
||||
|
||||
Did you find this example helpful?
|
Supported by objects:
External links:
User Contributed Comments