add class on active div using jquery
<p><a href="http://jsfiddle.net/sureshmonster/b3VaX/2/" rel="nofollow">JSFiddle</a>. I want to add class on current active div. I know i need to use addClass() but i don't know where i have to use that ?</p>

<p>html:</p>

<pre><code>&lt;div class="myclass selected"&gt;
Content 1
&lt;/div&gt;
&lt;div class="myclass"&gt;
    Content 2
&lt;/div&gt;
&lt;div class="myclass"&gt;
Content 3
&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;img     src="http://www.lillehammer.com/ImageVault/Images/id_2122/scope_66/ImageVaultHandler.aspx"     /&gt;&lt;/li&gt;
  &lt;li&gt;&lt;img     src="http://upload.wikimedia.org/wikipedia/commons/thumb/d/d7/Valued_image_seal.svg/40px-            Valued_image_seal.svg.png" /&gt;&lt;/li&gt;
  &lt;li&gt;&lt;img src="http://www.iconico.com/i/icoImageFilterPro100.gif" /&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;a class="next"&gt;next&lt;/a&gt;
</code></pre>

<p>jquery:</p>

<pre><code>$('img', 'ul').on('click', function() {
    $(".myclass").eq($(this).parent('li').index()).show()
                 .siblings('div').hide();
});

$('.selected').show();

$(".next").click(function(){
    if ($('.myclass:visible').length) {
        var curr = $('.myclass:visible'),
            next = curr.next('.myclass').length?    curr.next('.myclass'):$('.myclass').first();

        curr.hide();
        next.show();
    }else{
        $('.myclass').first().show();
    }
});
</code></pre>

<p>​
​</p>
