title: Jquery insert values of text-field into list-box.?
body: <p>I want to fetch value from the textfield and add to the listbox.
  Here is my <code>jquery code</code></p>
  
  <p><strong>JS:-</strong></p>
  
  <pre><code>{
  $('#btn_AddToList').click(function(
  {
      var select = document.getElementById('lst_Regions');
      var region = $('#txt_RegionName').val();
  
      if('' != region)
      {
          var newOption = document.createElement('option');
  
          newOption.text = region;
          newOption.value = region;
  
          if($.browser.msie)
          {
              select.add(newOption);
          }
          else
          {
              select.add(newOption, null);
          }
      }
  
      return false;
   });
  });
  </code></pre>
  
  <p>here is my <code>html code</code></p>
  
  <p><strong>html:</strong></p>
  
  <pre><code>&lt;input type="text" name="region" id="txt_RegionName" /&gt;&lt;br /&gt;
  &lt;input type="button" name="add" id="btn_AddToList" value="add" class="btn btn-success" /&gt;&lt;/br /&gt;
  &lt;select size="10" id="lst_Regions" style="width: 500px;"&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p><strong>question:</strong> I cannot add the value of the <code>txt_RegionName</code> to the <code>lst_Region</code> ,where i am going wrong?</p>
  
  <p>Thank you.</p>