The JavaScript print function window.print() prints the current webpage when executed. You can call this function directly using the onclick event as shown in the following example.
Example
<html> <body> <form> <input type = "button" value = "Print" onclick = "window.print()"/> </form> </body> </html>The following output is displayed on successful execution of the above code.
No comments:
Post a Comment