title: Get unique value from mutiple forms that have radio buttons - jQuery
body: <p>I'm creating a trivia game for a job interview and so far i've created a loop that populates forms with radio buttons for multiple choices.</p>
  <p>The problem I'm having is a score counter. I need to only count the correct responses, preferably on click per form. Right now when I select an answer and then click any other answer it adds to the score because at least one correct answer is selected,</p>
  <h3>HTML</h3>
  <pre><code>&lt;div id=&quot;trivia&quot;&gt;
      &lt;form class='card0'&gt;
         &lt;text&gt;Question&lt;/text&gt;
         &lt;input type=&quot;radio&quot; id=&quot;Answer&quot; value=&quot;correct&quot; name=&quot;question0&quot;&gt;
         &lt;label for=&quot;Answer&quot;&gt;Answer&lt;/label&gt;
         &lt;input type=&quot;radio&quot; id=&quot;Wrong&quot; value=&quot;incorrect&quot; name=&quot;question0&quot;&gt;
         &lt;label for=&quot;Answer&quot;&gt;Wrong&lt;/label&gt;
      &lt;/form&gt;
      &lt;form class='card1'&gt;
         &lt;text&gt;Question&lt;/text&gt;
         &lt;input type=&quot;radio&quot; id=&quot;Answer&quot; value=&quot;correct&quot; name=&quot;question1&quot;&gt;
         &lt;label for=&quot;Answer&quot;&gt;Answer&lt;/label&gt;
         &lt;input type=&quot;radio&quot; id=&quot;Wrong&quot; value=&quot;incorrect&quot; name=&quot;question1&quot;&gt;
         &lt;label for=&quot;Answer&quot;&gt;Wrong&lt;/label&gt;
      &lt;/form&gt;
  &lt;/div&gt;
  </code></pre>
  <h3>jQuery</h3>
  <pre><code> for(j=0;j&lt;21;j++){
          var score = 0;
          $('.card' + j + ' input').on('click', function(e){
              e.preventDefault();
              var radioVal = $('input[value=correct]').val();
              if(radioVal){
                  score+=1
                  console.log(score)
              }
          })
      }
  </code></pre>