title: Why val() is null in jquery
body: <p>I have below script:
      </p>
  
  <pre><code> $(document).ready(function () {
       $("#dpProject").change(function () {
           var idModel = $(this).val();
           var select = $("#dpYear");
           select.empty();
           $.getJSON("/Project/GetYearsOfProject", { projectId: idModel }, function  (mahaleData) {
               var select = $("#dpYear");
               select.empty();
               $.each(mahaleData, function (index, itemData) {
                  select.append($('&lt;option/&gt;', {
                      value: itemData.Value,
                      text: itemData.Text
                  }));
              });//each
              });//json
          alert($('#dpYear :selected').html());
  
  
      });
  </code></pre>
  
  <p></p>
  
  <p>Why when i want to alert selected item of dpYear it alerted null??
  Even i changed to text() it returned null so.
  I used jquery-1.7.1.js.</p>
  
  <p><strong>EDIT</strong>
  I have 2 dropdonwns and one textbox , When Dp1(dpProject) changed Dp2(DpYear) must reload and first item in Dp2 is selected for default, and after loading Dp2 , some methods must called and fill the textbox,So with changin Dp1 , text of the depended on first item Dp2 texbox must change, but selected item of Dp2(dpYear) return me null.</p>