Jquery same class show one hide others jsfiddle included
<p>I am trying to make a gallery with this code.</p>

<p>It works if i have two separate containers for buttons and contents but is there a way to just use one container for everything? </p>

<p>Also, without using extra classes like (one,two,three,...)</p>

<p>HTML:</p>

<pre><code>&lt;div id="content"&gt;this is a box&lt;/div&gt;
&lt;button&gt;First&lt;/button&gt;
&lt;div class="info"&gt;hahahaha&lt;/div&gt;
&lt;button&gt;Second&lt;/button&gt;
&lt;div class="info"&gt;hahahaha2&lt;/div&gt;
&lt;button&gt;Third&lt;/button&gt;
&lt;div class="info"&gt;hahahaha3&lt;/div&gt;
</code></pre>

<p>JS:</p>

<pre><code>    $(".info").hide();

$("button").click(function () {

    //replace stuff inside #content with .info in the div under each box
    $("#content").html($(this).find(".info"));

});
</code></pre>

<p><a href="http://jsfiddle.net/MsUVu/" rel="nofollow">http://jsfiddle.net/MsUVu/</a></p>
