I have some checkboxes that come from my database wich look like this:
<input type="checkbox" class="hidden chkbox" id="single_checkbox_<?php echo $page->ID; ?>" name="pages[]" value="<?php echo $page->ID; ?>"/>
<label rel="tooltip" data-original-title="Selecteer" class="btn" for="single_checkbox_<?php echo $page->ID; ?>"><i class="icon-check-empty"></i> Selecteer</label>
Now the checkboxes are hidden because i want the label class to act as the checkboxes.
it is in fact working but the problem is that is want to change <i class="icon-check-empty"></i> after the checkbox is clicked to <i class="icon-check"></i> and back to icon-check-empty after unchecked.
The jquery i have so far is
$('.chkbox').click(function(){
if($(this).is(':checked')){
$('i.icon-check-empty').replaceWith('<i class="icon-check"></i>');
}else{
$('i.icon-check').replaceWith('<i class="icon-check-empty"></i>');
}
});
It does change however it changes all the checkboxes and that isn't what i'm looking for.
If anybody has an idea on how to help me that would be great.
Kind regards.