title: Checkbox Check for yes command in javascript
body: <p>I want to get done, When i try to checked checkbox, It will show popup. Then, there have a two option as "Yes" and "NO". When i click "yes" checkbox will checked and popup close. If i choose "NO" checkbox will unchecked and close popup.
  Give me a help on this. Sample code here</p>
  
  <p>Javascript</p>
  
  <pre><code>$(document).ready(function () {
  $('#chkBox').click(function () {
      if ($(this).is(':checked')) {
          $("#txt").dialog({
              close: function () {
                  $('#chkBox').prop('checked', false);
              }
          });
      } else {
          $("#txt").dialog('close');
      }
  });
  });
  </code></pre>
  
  <p>HTML</p>
  
  <pre><code>&lt;input type="checkbox" id="chkBox" name="HelpCheckbox" value="Help" /&gt;
    &lt;div id="txt" style="display: none;"&gt;
         &lt;button&gt;Yes&lt;/button&gt;
          &lt;button&gt;NO&lt;/button&gt;
    &lt;/div&gt;
  </code></pre>
  
  <p>Live sample here : 
  <a href="http://jsfiddle.net/5vy1m233/37/" rel="nofollow noreferrer">http://jsfiddle.net/5vy1m233/37/</a></p>
  
  <p>Please help. Thank you.</p>