title: How to Get Value From HTML Dropdown List using Jquery
body: <p>I have dropdown list and i want to retrieve data from database when select value of downlist. This is working without having error. But this is working when i click on dropdown list, not in dropdown value. That mean work only for default value. please help me how to rectify this error. code as below.</p>
  
  <p>HTML code for Dropdown list</p>
  
  <pre><code>&lt;select name="lab_no" id="lab-no" class="form-control"&gt;
      &lt;option value="Lab 01" &gt;Lab 01&lt;/option&gt;
      &lt;option value="Lab 02"&gt;Lab 02&lt;/option&gt;
  &lt;/select&gt; 
  </code></pre>
  
  <p>Jquery Code is Here</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      $(document).ready(function () {
          $("option").click(function () {
              var txt = $("#lab-no:selected").val();
              if (txt = '') {
  
              } else {
                  $('#table-row').html('');
                  $.ajax({
                      url: "../svr/com-list.php",
                      method: "post",
                      data: {search: txt},
                      dataType: "text",
                      success: function (data) {
                          $('#table-row').html(data);
                      }
                  });
              }
          });
      });
  &lt;/script&gt;
  </code></pre>