Print pages in JavaScript
Many times you will love to put a button on your website to print the content of that page through a printer. JavaScript helps you perform this function by using the print function of the window object.
Many times you will love to put a button on your website to print the content of that page through a printer. JavaScript helps you perform this function by using the print function of the window object.
The window.print () function in JavaScript prints the current page when executed. You can call this function directly using the onclick event as in the following example:
For example
Try the following example:
MORE LIKE THIS
- How to Print Double Quotes in Java
- How to Create an Executable File from Eclipse
- How to Enable Webgl
- How to Create a Javascript Console in Sublime Text
- How to Close a Window in Java
- How to Print an Array in Java
- Introduction to 2D Array - 2-dimensional array in JavaScript
- How to Run Program C/C++ Program in Netbeans
- How to Enable JavaScript in Mozilla Firefox
- How to Check Null in Java
-
How to fix error 0x0000011b when printing over the network on Windows 11
-
Instructions on how to cancel a print job on a Brother printer simply and quickly.
-
How to cancel a print job on your computer easily and instantly.
-
5 best black and white printers currently available that you should buy, priced under 5 million VND.
-
How to print a document in Word without errors, easily.
-
Numeric data types in Python