The JavaScript print function performs the same operation as the print option that you see at the top of your browser window or in your browser’s “File” menu. The JavaScript print function will send the contents of the webpage to the user’s printer.
JavaScript Print Script – window.print()
The JavaScript print function window.print() will print the current webpage when executed. In this example script, we will be placing the function on a JavaScript button that will perform the print operation when theonClick event occurs.
<html> <body> <form> <input type="button" value="Print This Page" onClick="window.print()" /> </form> </body> </html>
0 comments:
Post a Comment