Populate select box with an array
<p>I have a form containing two radio button, one select box and two arrays.
If I select first radio button then the select box values should be populated with <code>array1</code> and if radio button 2 is selected then select box should be populated with <code>array2</code>.</p>

<pre><code>&lt;script type="text/javascript"&gt;
  var array1=["1","2","3"];
  var array2=["4","5","6"];
&lt;/script&gt;

&lt;form name="form" id="form"&gt;
  Radio button 1&lt;input name="btn1" id="a1" type="radio" value="Radio button 1"&gt;
  Radio button 2&lt;input name="btn1" id="a2" type="radio" value="Radio button 2" /&gt;

  &lt;select id="s1" name="myname"&gt;
    &lt;option selected&gt;&lt;/option&gt;
  &lt;/select&gt; 
&lt;/form&gt;

&lt;script type="text/javascript"&gt;
  $(document).ready(function(){

    $('#a1').change(function() {
      alert('do array1'); 
    });

    $('#a2').change(function() {
      alert('do array2');
    });

  })           
&lt;/script&gt;
</code></pre>

<p>I got the values of radio button, but how I'll populate select box with array values?</p>
