How to get the size of the screen, current web page, and browser window with JavaScript?

Sometimes, we want to get the size of the screen, current web page, and browser window with JavaScript.

In this article, we’ll look at how to get the size of the screen, current web page, and browser window with JavaScript.

How to get the size of the screen, current web page, and browser window with JavaScript?

To get the size of the screen, current web page, and browser window with JavaScript, we can use various properties.

For instance, we write

window.screen.height;
window.screen.width;

to get the screen’s height and width.

We use

document.body.clientHeight;
document.body.clientWidth;

to get the page’s height and width.

And we use

window.innerHeight;
window.innerWidth;

to get the browser’s height and width.

Conclusion

To get the size of the screen, current web page, and browser window with JavaScript, we can use various properties.

How to disable browser autocomplete on web form field/input tags with HTML?

Sometimes, we want to disable browser autocomplete on web form field/input tags with HTML.

In this article, we’ll look at how to disable browser autocomplete on web form field/input tags with HTML.

How to disable browser autocomplete on web form field/input tags with HTML?

To disable browser autocomplete on web form field/input tags with HTML, we can set the autocomplete attribute to off.

For instance, we write

<input type="text" name="foo" autocomplete="off" />

to set the autocomplete attribute to off in the input to disable autocomplete on it.

Conclusion

To disable browser autocomplete on web form field/input tags with HTML, we can set the autocomplete attribute to off.