I want to target the .sf-input-checkbox
class in this instance. But my (this)
is attached to the .searchandfilter
instead.
$(document).on("sf:ajaxfinish", ".searchandfilter", function(){
if ( $('.sf-input-checkbox').is(":checked") ) {
$(this).addClass('jordanchecked');
}
});
Result currently:
<div class="searchandfilter jordanchecked">
<input type="checkbox" class="sf-input-checkbox">
</div>
I am after this:
<div class="searchandfilter">
<input type="checkbox" class="sf-input-checkbox jordanchecked">
</div>