I have a simple page
<!DOCTYPE html>
<html>
<body>
<input id="niceBtn" type="button" value="Nice Button" onclick="showDiv()"/>
<div id="niceDiv" style="display:none;height:800px;width:40px;background-color:#F00;"></div>
</body>
<script type="text/javascript">
function showDiv(){
document.getElementById('niceDiv').style.display == "";
}
var resizer = function(){
alert('Hello')
};
window.onresize = resizer;
</script>
</html>
When I click the button, the '#niceDiv' is shown. When the div shows, why does the resizer not fire?
Am i not attaching to the right event? I need to attach to an event which fires on dynamic DOM modification. If the size of the document changes by adding some elements either from a AJAX response, or any javascript event, I need to alert "Hello"
How can I do this? Cannot use jQuery.
EDIT: I notice that when I resize the whole browser the event fires. How can I fire it when the DOM is resized.