title: Display an alert with message according to the radio button
body: <pre><code>&lt;html&gt;
  &lt;script&gt;
  function myFunction()
  {
  for(k=1; k&lt;=3; k++)
      checkVal(document.getElementsByName("radio"+k))     
  
  }
  
   function checkVal(selector){
   for (var i = 0; i &lt; selector.length; i++) {       
      if (selector[i].checked) {
          switch (selector[i].value){
              case '1' :
                  alert("You can't go")
                  break;
              case '2' :
                  alert("You can go")
                  break;
              }
  
          break;  
  
      }
     }
    }
  &lt;/script&gt;
  
     &lt;div&gt;
      &lt;p&gt;QUESTION 1&lt;/p&gt;&lt;/br&gt;&lt;/br&gt;
      &lt;input name="radio1" value="1" checked="" type="radio"&gt;Yes&lt;/br&gt;&lt;/br&gt;
      &lt;input name="radio1" value="2" type="radio"&gt;No&lt;/br&gt;&lt;/br&gt;
  
      &lt;p&gt;QUESTION 2&lt;/p&gt;&lt;/br&gt;&lt;/br&gt;
      &lt;input name="radio2" value="1" checked="" type="radio"&gt;Yes&lt;/br&gt;&lt;/br&gt;
      &lt;input name="radio2" value="2" type="radio"&gt;No&lt;/br&gt;&lt;/br&gt;
  
      &lt;p&gt;QUESTION 3&lt;/p&gt;&lt;/br&gt;&lt;/br&gt;
      &lt;input name="radio3" value="1" checked="" type="radio"&gt;Yes&lt;/br&gt;&lt;/br&gt;
      &lt;input name="radio3" value="2" type="radio"&gt;No&lt;/br&gt;&lt;/br&gt;
      &lt;input type="button" onclick="myFunction()" value="Send" /&gt;
    &lt;/div&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Hello i found this script on this site but i need to edit it.
  I don't know what i've to do because i don't know Javascript so i need your help...
  This function give me three alert but i need that if the user selects only one "yes" the function has to give to the user the <code>alert("you can't go")</code>.
  The <code>alert("you can go")</code> has to be shown only if the user selects all yes.
  Who can help me? &lt;3</p>