title: dropdown value change according to radio button
body: <p>Here is task in which when i select "12 hour" radio button then drop down value change in 1 am-12 am and 1 pm-12 pm and when i select 24 hours then my value change in 1-24.</p>
  
  <p>My code is:</p>
  
  <pre><code>&lt;script src="http://code.jquery.com/jquery-1.7.2.min.js"&gt;&lt;/script&gt;
  &lt;script&gt;
    var listA = [{name:'1am', value:'1am'}, {name:'2am', value:'2am'}, {name:'3am', value:'3am'}];
  
    var listB = [{name:'12', value:'12'}, {name:'13', value:'13'}, {name:'14', value:'14'}];
  &lt;/script&gt;
  &lt;script&gt;
    $(document).ready( function() {
      $(':radio').bind('click',function(){
        $('#describe')
          .find('option')
          .remove()
          .end();
        $.each(listA, function(index, value) {
          $('#describe').append('&lt;option value="'+value.value+'"&gt;'+value.name+'&lt;/option&gt;');
        });
      });
    });
  &lt;/script&gt;
  </code></pre>
  
  <p>Html code for this:</p>
  
  <pre><code>&lt;div&gt;
    &lt;select id="describe"&gt;
      &lt;option name="name" value="1"&gt;a&lt;/option&gt;
      &lt;option name="name" value="2"&gt;b&lt;/option&gt;
    &lt;/select&gt;
  &lt;/div&gt;
  &lt;div&gt;
    &lt;input type="radio" id="class" name="type" value="1" checked&gt;12 hour &lt;br/&gt;
    &lt;input type="radio" id="Club" name="type" value="2" &gt;24 hour&lt;br/&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Hope you understand my question.</p>