HOME HTML CSS JAVASCRIPT SQL PHP JQUERY XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

onresize Event

Event Object Reference Event Object

Example

Execute a JavaScript when the browser window is resized:

<body onresize="myFunction()">

Try it yourself »

Definition and Usage

The onresize event occurs when the size of an element has changed.

Syntax

In HTML:

<element onresize="SomeJavaScriptCode">

In JavaScript:

window.onresize=function(){SomeJavaScriptCode};

Parameter Description
SomeJavaScriptCode Required. Specifies a JavaScript to be executed when the event occurs


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The onresize event is supported in all major browsers.


onresize is Supported by the Following HTML Tags:

<a>, <address>, <b>, <big>, <blockquote>, <body>, <button>, <cite>, <code>, <dd>, <dfn>, <div>, <dl>, <dt>, <em>, <fieldset>, <form>, <frame>, <h1> to <h6>, <hr>, <i>, <img>, <input>, <kbd>, <label>, <legend>, <li>, <object>, <ol>, <p>, <pre>, <samp>, <select>, <small>, <span>, <strong>, <sub>, <sup>, <table>, <textarea>, <tt>, <ul>, <var>


Event Object Reference Event Object

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates

SHARE THIS PAGE