
- HTML Tutorial
- HTML - Home
- HTML - Overview
- HTML - Basic Tags
- HTML - Elements
- HTML - Attributes
- HTML - Formatting
- HTML - Phrase Tags
- HTML - Meta Tags
- HTML - Comments
- HTML - Images
- HTML - Tables
- HTML - Lists
- HTML - Text Links
- HTML - Image Links
- HTML - Email Links
- HTML - Frames
- HTML - Iframes
- HTML - Blocks
- HTML - Backgrounds
- HTML - Colors
- HTML - Fonts
- HTML - Forms
- HTML - Embed Multimedia
- HTML - Marquees
- HTML - Header
- HTML - Style Sheet
- HTML - Javascript
- HTML - Layouts
- HTML References
- HTML - Tags Reference
- HTML - Attributes Reference
- HTML - Events Reference
- HTML - Fonts Reference
- HTML - ASCII Codes
- ASCII Table Lookup
- HTML - Color Names
- HTML - Entities
- HTML - Fonts Ref
- HTML - Events Ref
- MIME Media Types
- HTML - URL Encoding
- Language ISO Codes
- HTML - Character Encodings
- HTML - Deprecated Tags
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 Articles
- Execute a script when the browser window is being resized in HTML?
- Execute a script when the browser window is closed in HTML?
- Which event occurs in JavaScript when the dragged element is over the target?
- What is cross-browser window resize events in JavaScript?
- How to delete a localStorage item when the browser window/tab is closed?
- Which event occurs in JavaScript when an element is dragged completely?
- 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 content is copied to clipboard?
- 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?
- Get the size of the screen, current web page and browser window in JavaScript
- How to detect the dragleave event in Firefox when dragging\noutside the window with HTML?
- Bootstrap Event when the modal is fully hidden

Advertisements