How to print Webpage content Using javascript-Easy tutorial

Share it with your friends Like

Thanks! Share it with your friends!

Close

Many times you would like to place a button on your webpage to print the content of that webpage via an actual printer. JavaScript helps you to implement this functionality using the print function of window object.

The java script print function window.print() prints the current webpage when executed. You can call this function directly using the on click event as shown in the video tutorial.

Comments

Zambian hackers says:

col work….tho i dnt like the background SONG

Chuck Backus says:

I already knew this. Why am I watching? Don't know. Perhaps the music hypnotized me. zzzzzzzzzzzzzzzzzzzzzzzz .

APEX Database Services says:

Hello, How about sending the output directly to the default printer? Is this easy to do, for example to print on a POS device/ thermal printer, without showing the preview? Thanks

mohamed abd allah says:

when write this function the console write window.print is not a function what is problem ?

Nfally Coly says:

simple and helpful, thx bro!

Jorge Mongelos says:

Thank you man! That was really helpful to finish my capstone project for my school to graduate as a Web/Software Developer. Thank you so fucking much!(Thanking with enthusiasm, and happines)

HWAK EYEs says:

Nice one Bhai

Write a comment

*