title: radio button option select item from dropdown
body: <p>I need to select an item from a dropdown when a specific radio button is checked. The first option should provide the whole list to select from and options 2 &amp; 3 should select/display their respective items in the dropdown without having to click on the dropdown.</p>
  
  <p>I've tried multiple jQuery options to tackle this but, none of them seem to work. The below code seemed to work in JSFiddle at some point, but not in CodePen or my local server. I don't write jQuery from scratch, so is there something I could be missing or have wrong?</p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;section id="options"&gt;
    &lt;input id="option1" name="option" rel="option1" type="radio" value="Option-1"&gt;
    &lt;label for="option1"&gt;Option 1&lt;/label&gt;
    &lt;br&gt;
    &lt;input id="option2" name="option" rel="option2 " type="radio" value="Option-2"&gt;
    &lt;label for="option2"&gt;Option 2&lt;/label&gt;
    &lt;br&gt;
    &lt;input id="option3" name="option" rel="option3" type="radio" value="Option-3"&gt;
    &lt;label for="option3"&gt;Option 3&lt;/label&gt;
  &lt;/section&gt;
  
  &lt;section&gt;
    &lt;select id="items" name="items"&gt;
      &lt;option value="none"&gt;Select Item&lt;/option&gt;
      &lt;option value="item1"&gt;Item 1&lt;/option&gt;
      &lt;option value="item2"&gt;Item 2&lt;/option&gt;
      &lt;option value="item3"&gt;Item 3&lt;/option&gt;
      &lt;option value="item4"&gt;Item 4&lt;/option&gt;
    &lt;/select&gt;
  &lt;/section&gt;
  </code></pre>
  
  <p>JS:</p>
  
  <pre><code>$(document).ready(function () {
      $('input[id="option1"]').change(function() {
          if ($('input[id="option1"]').attr('checked') == "checked") {
          $('#items option:eq(0)').attr('selected', 'selected')
          }
      });
      $('input[id="option2"]').change(function() {
          if ($('input[id="option2"]').attr('checked') == "checked") {
          $('#items option:eq(2)').attr('selected', 'selected')
          }
      });
      $('input[id="option3"]').change(function() {
          if ($('input[id="option3"]').attr('checked') == "checked") {
          $('#items option:eq(3)').attr('selected', 'selected')
          }
      });
  });
  </code></pre>