title: How to remove an item in DropDownList in ASP MVC using JavaScript
body: <p>I am developing an ASP .Net MVC 3 application using C# and SQL Server 2005.</p>
  
  <p>In a view, I have a DropDownList, a button.</p>
  
  <p>How can I remove an item from the DropDownList for each click of the button.</p>
  
  <p>I try to use javascript, but I think that's not working because when I click on the button, nothing happens.</p>
  
  <p>This is the code :</p>
  
  <pre><code>&lt;%:Html.Label("Poste :")%&gt;
  &lt;%:Html.DropDownListFor(
      model =&gt; model.SelectedPoste,
      Model.PostesItems,
      new { @id = "poste" })%&gt;
  
  &lt;div&gt;
      &lt;input type="submit"
             value="Enregistrer"
             id="btnSave"
             onclick="remove()" /&gt;
  &lt;/div&gt;
  
  &lt;script type="text/javascript"&gt;    
      function remove() {
          var rm = document.getElementById('btnSave');
          var poste = document.getElementById('poste');
  
          poste.removeItem(); 
      }
  &lt;/script&gt;
  </code></pre>