How to show a pop-up print dialog box using JavaScript?

Sometimes, we want to show a pop-up print dialog box using JavaScript.

In this article, we’ll look at how to show a pop-up print dialog box using JavaScript.

How to show a pop-up print dialog box using JavaScript?

To show a pop-up print dialog box using JavaScript, we can use the window.print method.

For instance, we write

window.print();  

to open the print dialog box of the browser.

Conclusion

To show a pop-up print dialog box using JavaScript, we can use the window.print method.