title: How to get label values of checkbox in javascript
body: <p>I have two <code>checkbox</code>, depending upon,which <code>checkbox</code> user clicks, I need to call other function, however, I'm not abler to get the <code>checkbox</code> label values.</p>
  
  <p><strong>Here is my code :</strong></p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function getLabel(id)
  {
    return $("#"+id).next().text();
  }
  function BillStatus(){
      console.log("its here");
      var label=getLabel('checkboxid1'); 
      console.log(label);
      if(label=="No") {
          //some function to call here
      }else{
         //other function to call here
      }
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;div id="check1"&gt;
      &lt;label&gt;
          &lt;input type="checkbox" name="myCheckbox" id="checkboxid1" onclick="BillStatus()" style="visibility: visible"/&gt; 
          Yes
      &lt;/label&gt;
  &lt;/div&gt;
  &lt;br&gt;
  &lt;div id="check2"&gt;
      &lt;label&gt;
          &lt;input type="checkbox" id="checkboxid2" name="myCheckbox" value="No" onclick="BillStatus()" style="visibility: visible" /&gt;
          No
      &lt;/label&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>