title: how to add textbox value to dropdown list
body: <p>I have one Dropdown list it has some values and other option,when i select other option it shows textbox ,i have to enter some text into it ,so i want to add that value to dropdown lilst,so how can i solve this?    </p>
  
  <pre><code>  &lt;!DOCTYPE html&gt;
      &lt;html&gt; 
      &lt;head&gt;  
      &lt;script type="text/javascript"&gt;
      function CheckColors(val){
       var element=document.getElementById('color');
       if(val=='pick a color'||val=='others')
         element.style.display='block';
       else  
         element.style.display='none';
      }
  
  
  
  
      &lt;/script&gt; 
      &lt;/head&gt;
      &lt;body&gt;
        &lt;select name="color" onchange='CheckColors(this.value);'&gt; 
          &lt;option&gt;pick a color&lt;/option&gt;  
          &lt;option value="red"&gt;RED&lt;/option&gt;
          &lt;option value="blue"&gt;BLUE&lt;/option&gt;
          &lt;option value="others"&gt;others&lt;/option&gt;
        &lt;/select&gt;
      &lt;input type="text" name="color" id="color" style='display:none;'/&gt;
      &lt;/body&gt;
      &lt;/html&gt;
  </code></pre>