title: body onload function is not working in my Example (JavaScript)
body: <p>I am writing a program to find sequence of execution of <strong>document.ready, window.onload, body.onload</strong>, but due to some reason my body.onload is not giving out console.log. Why?</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$(document).ready(function(){
      console.log('document is ready now ...');
  });
  
  window.onload = () =&gt; {
      console.log('window is loaded...');
  }
  
  function bodyOnload() {
      console.log('body is loaded...');
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;html&gt;
  
  &lt;head&gt;
  &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.12.4/jquery.min.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body onload="bodyOnload()"&gt;
  
  &lt;h1&gt;Hello ...&lt;/h1&gt;
  
  &lt;/body&gt;
  
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>