Although the documentation ( http://www.w3schools.com/jsref/event_onresize.asp ) states:
I can not get a situation where resizing a div causes the oresize handler to be executed.
It looks like onresize only works on the window object and the body tag.
Among other things, i tried this, a simple mod to the example code:
<!DOCTYPE html><html><head><script>function myFunction(){var w=window.outerWidth;var h=window.outerHeight;var txt="Window size: width=" + w + ", height=" + h;document.getElementById("demo").innerHTML=txt;}</script></head><body><div style="width:100%" onresize="myFunction()" ><p>Try to resize the browser window.</p><p id="demo"> </p><p>Note: this example will not work properly in IE8 and earlier. IE8 and earlier do not support the outerWidth/outerHeight propery of the window object.</p></div</body></html>
I would like to see a working example where the onresize event handler as attribute of a div tag is actually executed, or, if it is indeed not possible, to get the documentation updated according to the actual possibilities.