How to open Print Preview with JavaScript?

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.