title: javascript Change the Dropdown values based on other dropdown
body: <p>I have a requirement When selected a dropdown value, it has to filter or remove the values of other dropdown which has index that should be always greater than selected index of first dropdown.</p>
  
  <p>Ex:  <strong>First Dropdown values:</strong></p>
  
  <pre><code>01:00
  01:30
  02:00 // suppose i select 02:00 here
  02:30
  03:00
  03:30
  04:00
  04:30
  05:00
  05:30
  </code></pre>
  
  <p><strong>Second Dropdonw Values</strong> (on selected 02:00 in the above dropdown should look like below)</p>
  
  <pre><code>02:30
  03:00
  03:30
  04:00
  04:30
  05:00
  05:30
  </code></pre>
  
  <p>(Im using C# with Asp.net here.)</p>
  
  <p><strong>Any javascript to achieve above would be greatly appreciated</strong></p>
  
  <p>and using script as below as Salman Suggested</p>
  
  <pre><code>&lt;body onload="select()"&gt;
  &lt;script language="javascript"&gt;
  function select(){
  var select1 = document.getElementById("ddlFrom");
  var select2 = document.getElementById("ddlTo");
  select1.onchange = function filterDDL() {     // empty select2
  while (select2.firstChild) {
  select2.removeChild(select2.firstChild);
    }     
   if (select1.selectedIndex == 0)
    { 
    return; 
      }
    for (var i = select1.selectedIndex; i &lt; select1.options.length; i++)
     {  
      var o = document.createElement("option");
      o.value = select1.options[i].value;
      o.text = select1.options[i].text;
      select2.appendChild(o);
  
        }
     } 
  }&lt;/script&gt;
  </code></pre>
  
  <p>but not working...please help on this
  Thanks in advance</p>