Jquery click function with button and text
<p>Hello eveyone I'm trying to using click function.  When the user clicks the button, a second text will appear and the first one will be display none and then user clicks again using the same button this time third text will appear and the second text will be display and finally click the same button again fourth text will appear third one display none. </p>

<p>I have another button that user clicks this button the fourth text will be display none and the third text will appear and click again this button the third text will display none second text will appear and finally click this button second will diplay none the first text will appear. Here is my function:</p>

<pre><code> $("#slider1next").click(function () {

         var $next = $(".text:visible").hide().next();
         $next.length ? $next.show() : $(".text:first").show();

 });

 $("#slider2next").click(function () {

         var $next = $(".text:visible").hide().next();
         $next.length ? $next.show() : $(".text:first").show();

 });
</code></pre>

<p>​
Here is my html:</p>

<pre><code>&lt;button id="slider1next" &gt;Clickme&lt;/button&gt;
  &lt;p class="text" id="first_one"&gt;This is the first text&lt;/p&gt;
    &lt;p class="text" id="second_one" style="display:none"&gt;This is the second text&lt;/p&gt;
    &lt;p class="text" id="third_one" style="display:none"&gt;This is the third text&lt;/p&gt;
&lt;p class="text" id="fourth_one" style="display:none"&gt;This is the four text&lt;/p&gt;

&lt;br/&gt;
&lt;button id="slider2next" &gt;Clickme&lt;/button&gt;
</code></pre>

<p>And also you can see there </p>

<p><a href="http://jsfiddle.net/ganymedes/7kxAE/2/" rel="nofollow">http://jsfiddle.net/ganymedes/7kxAE/2/</a></p>

<p>Please help me</p>
