Try the following example:
type="button" value="Print" onclick="window.print()" />
Follow the above method to see the result
Although it serves printing purposes, it is not the recommended way to use it. A printer friendly page is really a page with text, no images, graphics or advertisements.
You can create a printer friendly page in the following ways:
Create a copy of the page and remove redundant text and graphics, then connect to the printer friendly page. You check the following example: For example.
If you do not want to keep an extra copy of the page, you can bookmark the printable text using appropriate comments like: ….. and then you can use PERL or any other script in the background to filter the printable text and display it for the final print job. You use this method to provide print media to your visitors. You check for example:
How to print a page
If you do not see the above media on a web page, then you can use the standard browser toolbar to print the web page. You follow the following link:
File → Print → Click OK button.