

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Which is the event when the browser window is resized in JavaScript?
Use window.outerWidth and window.outerHeight event in JavaScript to get the size of windows when the browser is resized.
Example
You can try to run the following code to work with events to check the browser window size −
<!DOCTYPE html> <html> <head> <script> function resizeFunction() { var val = "Window Width=" + window.outerWidth + ", Window Height=" + window.outerHeight; document.getElementById("test").innerHTML = val; } </script> </head> <body onresize = "resizeFunction()"> <p>Resize browser window and check the window (browser window) height and width again.</p> <p id = "test"> </p> </body> </html>
- Related Questions & Answers
- Execute a script when the browser window is being resized in HTML?
- Which event occurs in JavaScript when the dragged element is over the target?
- Execute a script when the browser window is closed in HTML?
- Which event occurs in JavaScript when a dragged element is dropped?
- Which event occurs in JavaScript when an element is getting dragged?
- Which event occurs in JavaScript when an element is dragged completely?
- How to delete a localStorage item when the browser window/tab is closed?
- Which event occurs in JavaScript when an element is content is copied to clipboard?
- What is cross-browser window resize events in JavaScript?
- Which event occurs in JavaScript when an element's content is cut?
- Which event occurs in JavaScript when an element's content is pasted?
- Which event occurs in JavaScript when the dragging of an element begins?
- Bootstrap Event when the modal is fully hidden
- Bootstrap Event when the modal is fully shown
- Which is the popular event promotion website in Hyderabad?
Advertisements