Categories
JavaScript Answers

How to open Print Preview with JavaScript?

Spread the love

Sometimes, we want to open Print Preview with JavaScript.

In this article, we’ll look at how to open Print Preview with JavaScript.

How to open Print Preview with JavaScript?

To open Print Preview with JavaScript, we use the window.print method.

For instance, we write

window.print()

to open the print preview dialog with JavaScript.

Conclusion

To open Print Preview with JavaScript, we use the window.print method.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *