This opens a Print Dialog Box, which tells the user to select desired printing options.
Browser Support: Chrome, Internet Explorer, Firefox, Safari, Opera.
You can use this function using the onclick event as shown in the example below:
<html> <head> </head> <body> <form> <input type="button" value="Print" onclick="window.print();" /> </form> </body> <html>
Read Also: HTML noscript Tag
If this is disabled then, saving them frustration of clicking a same button which does absolutely nothing:
File > Print > Click OK button.
- Ready a page for printing
- Make that page printer friendly
- Allow users to choose to print
- Never attach this to any user event