I have a list of checkboxes under a div. How can I uncheck all the other check boxes when I am clicking on one input in this case?
Please help
jQuery(document).ready(function($) {
$('.pgggo-container-ajax-sorting').on('click', '.pgggo-list-taxon input', function() {
alert("okay");
});
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div class="pgggo-container-ajax-sorting">
<div class="pgggo-list-taxon">
<ul>
<li><label><label><input name="pgggo-category-sep-3[]" type="checkbox" /></label></label>
<div>
<div>Category 2</div>
</div>
</li>
<li><label><label><input name="pgggo-category-sep-4[]" type="checkbox" /></label></label>
<div>
<div>Category 3</div>
</div>
</li>
<li><label><label><input name="pgggo-category-sep-2[]" type="checkbox" /></label></label>
<div>
<div>Category1</div>
</div>
</li>
<li><label><label><input name="pgggo-category-sep-1[]" type="checkbox" /></label></label>
<div>
<div>Uncategorized</div>
</div>
</li>
</ul>
</div>
</div>
Aucun commentaire:
Enregistrer un commentaire