I need to detect DOM changes (especially when adding DOM elements). 
So that a method may be called in Chrome, Firefox, IE9+ 
Let's assume we have a button to add li dynamically as follows:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js" type="text/javascript"></script>
<input id="btn" type="submit" value="Add Item"> 
<ul/>
<script type="text/javascript">
    $("#btn").click(function(){
        $("<li />").html("item").appendTo("ul");
    })
</script>
I need something like that to detect li additions for example:
onDomChange(function(){ 
    alert("DOM changed !");
});
I've implemented this solution: 
http://jsfiddle.net/Lcybj/
but  it only works on Chrome.
How to achieve a solution to work on 3 browsers ?
 
    