Horje

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




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