title: Text box to appear when a radio button is selected
body: <p>I want to get a text box to appear when a radio button is selected yes . This is what my code looks like; </p>
  
  <pre><code>Care of Address? &lt;br&gt;
  Yes&lt;input type="radio" name="radio1" value="Yes" onClick="getResults(this)"&gt;
  No&lt;input type="radio" name="radio1" value="No" onclick="getResults(this)"&gt;
  
  &lt;div class="text"&gt;&lt;p&gt;Address Line 1  &lt;input type="text" name="text1" id="text1" maxlength="30"&gt;&lt;/p&gt;&lt;/div&gt;
  &lt;div class="text"&gt;&lt;p&gt;Address Line 2 &lt;input type="text" name="text2" id="text2" maxlength="30"&gt;&lt;/p&gt;&lt;/div&gt;
  &lt;div class="text"&gt;&lt;p&gt;Address Line 3  &lt;input type="text" name="text3" id="text3" maxlength="30"&gt;&lt;/p&gt;&lt;/div&gt;
  &lt;div class="text"&gt;&lt;p&gt;Address Line 4 &lt;input type="text" name="text4" id="text4" maxlength="30"&gt;&lt;/p&gt;&lt;/div&gt;
  &lt;div class="text"&gt;&lt;p&gt;Postcode  &lt;input type="text" name="text5" id="text5" maxlength="30"&gt;&lt;/p&gt;&lt;/div&gt;
  
  &lt;script&gt; 
      (document).ready(function() {
          (".text").hide()
  
      });
      function getResults(elem) {
          elem.checked &amp;&amp; elem.value == "Yes" ? (".text").show() : (".text").hide();
      };
      &lt;/script&gt;
  </code></pre>
  
  <p>Can anyone help me </p>
  
  <p>Abi</p>