How to check checkboxs based on text string HTML/JS – Jquery
Is it possible to check checkbox based on string text using js or jQuery: $(':checkbox').filter(function() { return $(this).parent().next('label').text() === 'Text 1'; }).prop('checked', true); <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <label class="selectit"><input value="171" type="checkbox" name="post_category[]" id="in-category-171">Text 1</label> <label class="selectit"><input value="172" type="checkbox" name="post_category[]" id="in-category-172">Text 2</label> <label…