title: I want to change which option that is selected in a combobox (<select>) with radiobuttons?
body: <p><strong>html: simple select with a few options.</strong></p>
  
  <pre><code>&lt;select id="link"&gt;
          &lt;option&gt;Small&lt;/option&gt;
          &lt;option&gt;Medium&lt;/option&gt;
          &lt;option&gt;Large&lt;/option&gt;
          &lt;option&gt;XLarge&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p><strong>jquery: I have duplicated the select and then converted them into radiobuttons.</strong></p>
  
  <pre><code>$(document).ready(function()
  {
      $('#link').each(function(i, select){
      var $select = $(select);
      $select.find('option').each(function(j, option){
      var $option = $(option);
      // Create a radio:
      var $radio = $('&lt;input type="radio" name="radios" value="all"/&gt;');
      // Set name and value:
      $radio.attr('name', $select.attr('name')).attr('value', $option.val());
      // Set id
      $radio.attr('id', $option.val());
      // Set checked if the option was selected
      if ($option.attr('selected')) $radio.attr('checked', 'checked');
      // Insert radio before select box:
      $select.before($radio);
      // Insert a label:
      $select.before(
        $("&lt;label&gt;").attr('for', $option.val()).text($option.text())
      );
      });
      });
  });
  </code></pre>
  
  <p>Here is my jsfiddle: <a href="http://jsfiddle.net/T2Cc6/" rel="nofollow">http://jsfiddle.net/T2Cc6/</a></p>