title: Getting the selected value from dropdownlist in asp.net
body: <p>I have been trying to get the selected item value from a dropdownlist but it seems like it is not going to work. I have looked at the other topics and I know that this question has been asked several times, but I need help. I have tried the following code:</p>
  
  <pre><code>$('ddlWorkHourFact option:selected').val()
  </code></pre>
  
  <p>but it returns me "undefined" and I don't know why.</p>
  
  <p>Here is my dropdownlist:</p>
  
  <pre><code>&lt;asp:DropDownList ID="ddlWorkHourFact"  runat="server"&gt;
                              &lt;asp:ListItem Value="7" Text="7"&gt;7&lt;/asp:ListItem&gt;
                              &lt;asp:ListItem Value="8" Selected="True" Text="8"&gt;8&lt;/asp:ListItem&gt;
                              &lt;asp:ListItem Value="9" Text="9"&gt;9&lt;/asp:ListItem&gt;
                          &lt;/asp:DropDownList&gt;
  </code></pre>