title: Attach event to child elements
body: <pre><code>&lt;div class="tabContainer"&gt;
    &lt;ul class="Tabs" id="tabset"&gt;
      &lt;li id="tab1" class="selected" onclick="tabs(this)"&gt;Home&lt;/li&gt;
      &lt;li id="tab2" onclick="tabs(this)"&gt;Tab 2&lt;/li&gt;
      &lt;li id="tab3"  onclick="tabs(this)"&gt;Tab 3&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I want to remove <code>onclick="tabs(this)"</code> and turn it into an event. How can I do this?
  Currently the below code is my solution which isn't working.</p>
  
  <pre><code>var h=$("tabset").children;
  for (i=0;i&lt;h.length;i++) h[i].onclick=tabs(this);
  </code></pre>
  
  <p>Oh and no jquery please, but <code>var $ = function(x){return document.getElementById(x)};</code>
  NOTE: I need the <code>(this)</code> part.</p>