title: How to select my second radio button in javascript without using id?
body: <p>Hee, I'm working on something but can and dont want to change the HTML. Adding an ID button is not possible. I want to select the second radio input.</p>
  
  <p>This is the html:</p>
  
  <pre class="lang-html prettyprint-override"><code>  &lt;fieldset&gt;
          &lt;legend&gt;I want to sign up:&lt;/legend&gt;
          &lt;label&gt;
              &lt;input type="radio" name="submit-for" value="project"&gt;
              &lt;span&gt;For project&lt;/span&gt;
          &lt;/label&gt;
          &lt;label&gt;
             &lt;input type="radio" name="submit-for" value="stage"&gt;
             &lt;span&gt;As intern&lt;/span&gt;
         &lt;/label&gt;
    &lt;/fieldset&gt;
  </code></pre>
  
  <p>This are the ways i tried selecting it in javascript but it didnt work:</p>
  
  <pre class="lang-js prettyprint-override"><code>   document.querySelector('input[type="radio"]:nth-of-type(2)').onclick = function () {
         document.getElementById("project").style.display = 'none';
         document.getElementById("stage").style.display = 'block';
     };
  </code></pre>
  
  <p>and </p>
  
  <pre class="lang-js prettyprint-override"><code>   document.querySelector('input[type="radio"]:nth-child(2)').onclick = function () {
         document.getElementById("project").style.display = 'none';
         document.getElementById("stage").style.display = 'block';
     };
  </code></pre>
  
  <p>Can someone please help?</p>