title: Add selected tag using HTML Helper DropDownListFor
body: <p>I'm using ASP.NET HTML helpers to generate and HTML dropdown list. So basically I have the following code:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code> @Html.DropDownListFor(model =&gt; model.DropDownListName, new List&lt;SelectListItem&gt; {
             new SelectListItem{Text="Option 1", Value="1",Selected=true},
             new SelectListItem{Text="Option 2", Value="2", Selected = false},
             new SelectListItem{Text="Option 3", Value="3", Selected = false}},
             new { @class = "myClass" });</code></pre>
  </div>
  </div>
  </p>
  
  <p>The Helper does generate and HTML dropdown with the corresponding options, the problem is that I would like to add the "selected" attribute to the HTML tag corresponding to the selected value to the dropdown and this is not generated.</p>
  
  <p>Actually my final goal is to have a way to get the selected option in my JavaScript and here is the code I was using to do that before using an HTML Helper:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var _selectedObjectId = parseInt($('#selectObject :selected').attr("id"));</code></pre>
  </div>
  </div>
  </p>