Loop does not give the desired result
<p>This loop is not working - it does not give the desired result. Output is may june july it should be from jan</p>

<pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
&lt;title&gt;Untitled Document&lt;/title&gt;

&lt;script type="text/javascript"&gt;

function change () {  
    var x= new Array('jan_feb_march_april','may_june_july');
    month= document.getElementById('slt');
    for (i=0;i&lt;x.length;i++) {
        name= x[i];
        var y= name.split('_');
    }


    for (z=0;z&lt;y.length;z++) {

        option=document.createElement('option');
        option.text=y[z];
        option.vlaue=y[z];   
        month.add(option, null)
    }
}


&lt;/script&gt;

&lt;/head&gt;

&lt;body&gt;
&lt;input type="button" value="click" onclick="change ()" /&gt;
&lt;select id="slt"&gt;&lt;/select&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>
