title: How to select the next element with same class?
body: <p>My question is formed by two parts:</p>
  
  <ol>
  <li>How to select the next element with the same class and hide the previous one?</li>
  <li>How can I add in each input hidden value, the value of button that is pressed? Let's say I press the button with class 'no'. I want the 'no' to go in it's input hidden value of the question. How to do that?</li>
  </ol>
  
  <p>Thank you so much. Any kind of help would be kindly appreciated.</p>
  
  <p>This is what I have so far:</p>
  
  <p>HTML:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$('.answer_buttons a').on('click', function(e){
      e.preventDefault();
      $('.selected').removeClass('selected').hide().next().show().addClass('selected');
      $.ajax({
          type: "POST",
          url: '',
          data: {},
          success: function(msj){
              //alert('test');
              //console.log(msj);
          }
      });
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;form action="" method="post"&gt;
    &lt;input name="intr1" value="" type="hidden"&gt;
    &lt;p class="question selected" id="intreb_1"&gt;
      Intrebarea 1?&lt;/p&gt;
    &lt;input name="intr2" value="" type="hidden"&gt;
    &lt;p class="question " id="intreb_2"&gt;
      Intrebarea 2?&lt;/p&gt;
    &lt;input name="intr3" value="" type="hidden"&gt;
    &lt;p class="question " id="intreb_3"&gt;
      Intrebarea 3?&lt;/p&gt;
    &lt;input name="intr4" value="" type="hidden"&gt;
    &lt;p class="question " id="intreb_4"&gt;
      Intrebarea 4?&lt;/p&gt;
    &lt;input name="intr5" value="" type="hidden"&gt;
    &lt;p class="question " id="intreb_5"&gt;
      Intrebarea 5?&lt;/p&gt;
    &lt;div class="answer_buttons"&gt;
      &lt;a class="nu" href=""&gt;&lt;/a&gt;
      &lt;a class="da" href=""&gt;&lt;/a&gt;
    &lt;/div&gt;
  &lt;/form&gt;</code></pre>
  </div>
  </div>
  </p>