title: How to uncheck a checkbox using jQuery
body: <p>I need to uncheck a dynamically created checkbox. When the checkbox is clicked I need to see whether the value is already present in the database or. If present, then I want to uncheck the checkbox. I tried different ways, but nothing is working.</p>
  
  <pre class="lang-js prettyprint-override"><code>$(document).on('change', '.subareachk', function() {
    var id = $(this).val();
    $.ajax({
      url: '{!! url('validatesubarea') !!}',
      type: 'get',
      data: {
        'id': id,
      },
      dataType: 'json',
      success: function(data) {
        if (data.length &gt; 0) {
          alert('Already a Store has been assigned for this sub area');
          $(this).prop('checked', false);
        }
      },
    });
  });
  </code></pre>