Print a webpage using javascript
Creating a simple Html button using as a print button whereby it prints current webpage. This action goes to javascript.
With this simple method, it is supported by all browsers including chrome, Firefox, explorer and opera.
This method is called window print() method.
Example
Print the current page:
window.print();
Definition and Usage
The print() method prints the contents of the current window.
The print() method opens the Print Dialog Box, which lets the user to select preferred printing options.
With this, I'll demostrate to you an example as seen below.
<button onlick="window.print();">Print</button>
#js #printbutton #javascript #javascript_print_button
Comments
Post a Comment