Horje
HTML onresize Attribute

Definition and Usage

The onresize attribute fires when the browser window is resized.


Applies to

The onresize attribute is part of the Event Attributes, and can be used on the following element:

Elements Event
<body> onresize

Browser Support


How to Execute a JavaScript when the browser window is resized - HTML onresize Attribute

Try to resize the browser window.
index.html
Example: HTML
<!DOCTYPE html>
<html>

<body onresize="myFunction()">

<p>Try to resize the browser window.</p>

<script>
function myFunction() {
  alert("You have changed the size of the browser window!");
}
</script>

</body>
</html>

Output should be:

How to Execute a JavaScript when the browser window is resized - HTML onresize Attribute




html onresize attribute

Type:
Develop
Category:
Web Tutorial
Sub Category:
HTML Attribute
Uploaded by:
Admin


Read Article
https://develop.horje.com/learn/1434/reference