title: How to set value to label in jsp page through jquery
body: <p>This is my label.</p>
  
  <pre><code>&lt;label class="control-label " for="no1" id="lbl_count"&gt;0&lt;/label&gt;
       &lt;button type="submit" class="btn btn-primary" id="submit_btn"&gt;Add to cart&lt;/button&gt;
  </code></pre>
  
  <p>And this is the function I try to set amount of raw in the jsp page to a label. But it is not working. Both label and button not are in same div. But both of them are in same form.
  <br/></p>
  
  <pre><code>   &lt;script&gt;
          $('document').ready(function() {
              $('#submit_btn').click(function() {
  
                  var x = document.getElementById("mytable").rows.length;
                  alert(x);
                  //    $("label[for='no1']").text(x);
                 //     $("#lbl_count").text(x);
              });
          });
      &lt;/script&gt;
  </code></pre>
  
  <p><br/>
  I tried several ways non of them are working.. Alert is working. That means data is coming. So how to fix this. Please help me. Thank you. </p>