The onresize
attribute event is triggered
when the browser window is resized.
The onresize
attribute is new in HTML5.
<element onresize="script or Javascript function name">
<body>
onresize |
Yes | Yes | Yes | Yes | Yes |
<!DOCTYPE html>
<html>
<!-- ww w . ja va 2s. co m-->
<body onresize="myFunction()">
<p>resize the browser window.</p>
<script>
function myFunction() {
alert("resized!");
}
</script>
</body>
</html>