title: Jquery to get the id of selected value from dropdown
body: <p>I have a drop down list that fetches values from db as follows</p>
  
  <pre><code>$.get('/getJobs', function (jobs) {
          seljobs = jobs;
          var i = 0;
          jobs.forEach(function (n) {
                             alert("job id----"+n.id)// 32,67,45
                             alert("job names----"+n.names)//test1,test2,test3
  
              html += '&lt;option value="' + i + '"&gt;' + n.names + '&lt;/option&gt;';
              i++;
          });
          $('#jobSel').html(html);
      });
  </code></pre>
  
  <p>i have to get the <code>id</code> of selected dropdown value..</p>
  
  <p>ic in my dropdown i have name values <code>test1,test2,test3</code> ans assosiated <code>id's 32,67,45,</code></p>
  
  <p>while selecting test1 i have to get id 32 and so ans so.How it is possible</p>
  
  <pre><code>&lt;tr&gt;
                          &lt;td width="200px"&gt;Jobs&lt;/td&gt;
                          &lt;td&gt; 
                              &lt;select id="jobSel" class="longcombo"&gt;&lt;/select&gt;
                          &lt;/td&gt;
                      &lt;/tr&gt; 
  </code></pre>