title: How can I convert a button click with an onload event?
body: <p>How can I convert this script so that it fires <code>onload</code> rather than using a button click?  I'm trying to understand this but it is not sinking in.</p>
  <pre><code>&lt;script type=&quot;text/javascript&quot;&gt; 
  jQuery(function($){
      // unordered list
      $('button.item').click(function(){
          $('ul').foo();
      });
      
  });
  &lt;/script&gt;
  &lt;/head&gt;     
  &lt;body&gt;
  &lt;ul&gt;
      &lt;li&gt;1&lt;/li&gt;
      &lt;li&gt;2&lt;/li&gt;
      &lt;li&gt;3&lt;/li&gt;
      &lt;li&gt;4&lt;/li&gt;
      &lt;li&gt;5&lt;/li&gt;
      &lt;li&gt;6&lt;/li&gt;
  &lt;/ul&gt;
  &lt;button class=&quot;item&quot;&gt;foo&lt;/button&gt;
  </code></pre>