title: Alternative for using body onload
body: <p>I'm a newbie and i'm playing around trying to achieve something using javascript.</p>
  
  <p>I have a function which i need to take effect once my page loads but i don't want to use <code>&lt;body onload="init()"</code> is there another alternative?</p>
  
  <pre><code>            &lt;script type="text/javascript"&gt;
              function init() {
              container = document.createElement('div');
              &lt;script&gt;
  
              &lt;body onload="init()"&gt;
  
              &lt;/body&gt;
  </code></pre>