How to Add a Print Button to HTML Page
Follow this step by step tutorial to learn how to add a print button in to html page.
Don't forget to check out our site http://howtech.tv/ for more free how-to videos!
http://youtube.com/ithowtovids - our feed
http://www.facebook.com/howtechtv - join us on facebook
https://plus.google.com/103440382717658277879 - our group in Google+
A print button on your web page will allow your visitors to quickly print the contents of the page. When the button is pressed, the browser's print dialog box will pop up. Then all the user has to do is choose his printer from the list, change the properties if he desires, and then click "OK" to print the web page.
Step #1 -- Open index.html in editor
Open index.html file in any html editor or notepad I use free online html editor.
Step # 2 -- Write HTML code
You can easily add a print button to your website by adding the onclick="window.print(); script to your anchor tag. Simply put, you're forcing the link you created to open up the browsers' default printer settings instead of opening up a new window or sending a user to a different page.
(a title="Print Screen" alt="Print Screen" onclick="window.print();" target="_blank" style="cursor:pointer;" )PRINT BUTTON(/a)
Step # 3 -- Submit you code
Save the HTML file and upload it to your website. Click the print button to test it out.
Step # 4 -- Click print button.
That's it for this video on How to add a Print button to your website. .Now you have been successfully installed print button in you webpage.
Follow this step by step tutorial to learn how to add a print button in to html page.
Don’t forget to check out our site http://howtech.tv/ for more free how-to videos!
http://youtube.com/ithowtovids – our feed
http://www.facebook.com/howtechtv – join us on facebook
https://plus.google.com/103440382717658277879 – our group in Google+
A print button on your web page will allow your visitors to quickly print the contents of the page. When the button is pressed, the browser’s print dialog box will pop up. Then all the user has to do is choose his printer from the list, change the properties if he desires, and then click “OK” to print the web page.
Step #1 — Open index.html in editor
Open index.html file in any html editor or notepad I use free online html editor.
Step # 2 — Write HTML code
You can easily add a print button to your website by adding the onclick=”window.print(); script to your anchor tag. Simply put, you’re forcing the link you created to open up the browsers’ default printer settings instead of opening up a new window or sending a user to a different page.
(a title=”Print Screen” alt=”Print Screen” onclick=”window.print();” target=”_blank” style=”cursor:pointer;” )PRINT BUTTON(/a)
Step # 3 — Submit you code
Save the HTML file and upload it to your website. Click the print button to test it out.
Step # 4 — Click print button.
That’s it for this video on How to add a Print button to your website. .Now you have been successfully installed print button in you webpage.
❗ Subscribe To Our Main YouTube Channel
https://www.youtube.com/user/howtechpc
Awesome video.
Using button tag
<button target="blank" style="cursor: pointer" onclick="window.print();">Print</button>
So thankful I found this video. It helped me solve a simple problem where all other sites I was referencing were using javascript to accomplish the same thing. Thank you.
To anyone looking to remove the print button:
1) Add class="print-button" to the print button.
2) Add @media print { .print-button { display:none; } } to your CSS in a <style> element.
thanks alot
thanks,but i dont want printer to print "PRINT BUTTON" or my url on my paper
THANK YOU 🙂
Thanks a lot mam, It definitely works but I want to print a particular portion like a <div> which contains I need to print out only. Besides this way "Ctrl+P" works the same. How it will possible? Pls. help in this regards . Thanks once again.
THANKS BUT I WANT TO Remove print Button how i can do this ?
Is that only to add a printer to the web page
Is there any way I can use an JPG image as a print screen?
Very useful. Thank you!