Printing the page on button click

We can use one button to give print command for the page at client side machine. The command print() will invoke the default print window at the client side. This command can be used along with a button or can be used inside the body tag of the page so the print command can be executed for the full page while page is loaded to the browser.

<input type=button onclick="window.print()" value='Print this page'>
Here is the Demo

If you want print command while the page on load

<body onload="window.print()">


* indicates required
Subscribe to plus2net

    mefor louis


    i love quick on point solutions like this thanks
    Arun Kumar Gangwar


    if we want prints some part of page as like a div.

    Post your comments , suggestion , error , requirements etc here .

    We use cookies to improve your browsing experience. . Learn more
    HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
    ©2000-2024 All rights reserved worldwide Privacy Policy Disclaimer