title: assign value to dropdown using javascript
body: <p>i have wriiten javascriot for two levels of dropdown on selecting value in first i get values in second dropdown. now what is happening the value that is there in the array is getting assigned to the second dropdown. i want to assign urls as values to the second dropdown and redirect them to those dropdowns.in my below example if i select apparel then i get men and women in second dropdown so if i select men in second dropdown it should go to xyz.com.... so for each option in second dropdown i want it to be redirected to a specific url how can i do it?</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  
  &lt;script type="text/javascript"&gt;
  
  var categories = [];categories["startList"] = ["Apparel","Books"]
  categories["Apparel"] = ["Men","Women"];
  categories["Books"] = ["Biography","Fiction","Nonfiction"];
  
  
  var nLists = 2; // number of lists in the set
  
  function fillSelect(currCat,currList){
  var step = Number(currList.name.replace(/\D/g,""));
  for (i=step; i&lt;nLists+1; i++) {
  document.forms[0]['List'+i].length = 1;
  document.forms[0]['List'+i].selectedIndex = 0;
  }
  var nCat = categories[currCat];
  //var nurl= url[currCat]
  for (each in nCat)  {
  var nOption = document.createElement('option'); 
  var nData = document.createTextNode(nCat[each]); 
  nOption.setAttribute('value',nCat[each]); 
  nOption.appendChild(nData); 
  currList.appendChild(nOption); 
  } 
  }
  
  function getValue(isValue) {
  alert(isValue);
  }
  
  function init() {
  fillSelect('startList',document.forms[0]['List1'])
  }
  
  navigator.appName == "Microsoft Internet Explorer" ? attachEvent('onload', init, false) : addEventListener('load', init, false);    
  
  &lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  &lt;form action=""&gt;
  &lt;select name='List1' onchange="fillSelect(this.value,this.form['List2'])"&gt;
  &lt;option selected&gt;Make a selection&lt;/option&gt;
  &lt;/select&gt;
  &amp;nbsp;
  &lt;!--&lt;select name='List2' onchange="fillSelect(this.value,this.form['List3'])"&gt;
  &lt;option selected&gt;Make a selection&lt;/option&gt;
  &lt;/select&gt;--&gt;
  &amp;nbsp;
  &lt;select name='List2' onchange="getValue(this.value)"&gt;
  &lt;option selected &gt;Make a selection&lt;/option&gt;
  &lt;/select&gt;
  &lt;/form&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>