เมื่อปรับขนาดหน้าต่างเว็บเบราว์เซอร์ onresize ทริกเกอร์แอตทริบิวต์
ตัวอย่าง
คุณสามารถลองเรียกใช้โค้ดต่อไปนี้เพื่อใช้งาน onresize แอตทริบิวต์ −
<!DOCTYPE html>
<html>
<body onresize = "display()">
<p>Resize the window to trigger event.</p>
<script>
function display() {
alert("Web browser window resized!");
}
</script>
</body>
</html>