Categories
JavaScript Answers

How to change the browser zoom level with JavaScript?

Spread the love

Sometimes, we want to change the browser zoom level with JavaScript.

In this article, we’ll look at how to change the browser zoom level with JavaScript.

How to change the browser zoom level with JavaScript?

To change the browser zoom level with JavaScript, we set the zoom style.

For instance, we write

document.body.style.zoom = "80%";

to set the zoom style of the body element to '80%' to set the zoom of the page to 80%.

Conclusion

To change the browser zoom level with JavaScript, we set the zoom style.

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 *