Home / Snippets / How to toggle Print Preview for Browsers
How to toggle Print Preview for Browsers cover

How to toggle Print Preview for Browsers

251

2 years ago

0 comments

To toggle the print preview on all browsers you can make use of the "print()" method available to the "window" global object.

Toggle Print Preview using JavaScript

window.print()
You can bind this to a button onclick method and right away after the button is pressed, the print preview of each respective browser will be shown to the user.

Print Preview on Firefox

notion avatar

Alaz

Week-end developer currently experimenting with web, mobile, and all things programming.

Topics:

Frontend

Resource

Average

Average

Support Us

If you like our tutorial, support us by being our Patreon or buy us some coffee ☕️

Welcome to PostSrc V3

PostSrc Dark Logo

You have to login to favorite this