HTML onresizeEvent Attribute

HTML 事件属性HTML Event Attributes

Example

Run script when the window is resized:

<body onresize="showMsg()">

Try it Yourself »

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the onresize event attribute


Definition and Usage

The onresize attribute triggers when the window is resized.

The onresize attribute is commonly used when resizing the window.


Differences Between HTML 4.01 and HTML5

None.


Syntax

<element onresize="script">

Attribute Value

Value Description
script Specifies the script to be executed when the onresize event is triggered.


HTML 事件属性HTML Event Attributes Other Extensions