Problem with adding class to every children node
<p>I have problem with adding class to every list element. This is example html:</p>

<pre><code>&lt;ul id="main_list"&gt;
    &lt;li&gt;item1&lt;/li&gt;
    &lt;li&gt;item2&lt;li&gt;
&lt;ul&gt;
</code></pre>

<p>And my jquery code which i don't understand why it don't work like i expect:</p>

<pre><code>   $(function(){
        $('#main_list').children().each(function(){
            $(this).addClass(function(){
                return $(this).index()})
            })
          })
</code></pre>
