JSFiddle - React, Tailwind, and code Playground

HTML

<script>
    var a=0;      
     document.addEventListener('DOMContentLoaded', function() {
         alert(a+" : DOMContentLoaded");
         a=a+1;
     }, false);



window.onload=function(){
     alert(a+" :onload");
     a=a+1;
};
</script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.js"></script>
<script>
    


$( document ).ready(function() {
        alert(a+" :ready");
        a=a+1;
          
});


getready();

function getready(){
document.onreadystatechange = function() {
   if (this.readyState === "complete"){
      
    
     alert(a+" :complete");
        a=a+1;
   }
    else if(this.readyState ===  "interactive"){
       
       alert(a+" :interactive");
        a=a+1;
   getready();
    }
    
    else if(this.readyState ===  "loading"){
       
      a=a+': onloading';
         a=a+1;
  getready();
    }
    
};
}

</script>