Is it possible to detect DIV content change ?


For example:
I have a div ...

<div id="mydiv">

</div>


Whenever a new content is loaded into this div I want to call a javascript function ...something like this ..



<div id="mydiv" onload="myFunc()">

</div>


However this does not work.


What is the correct way to do this ?