This works fine if I don’t check both boxes. Not sure how to fix it.
$(".home-check").live('click', function() {
if ($(".home-check").is(':checked')) {
var ident = $(this).attr('id');
$('.' + ident).hide();
} else {
var identt = $(this).attr('id');
$('.' + identt).show();
}
});
<p><input class="home-check" id="water" type="checkbox" name="gethired" />Fire - Only Show Fire</p>
<p><input class="home-check" id="fire" type="checkbox" name="hire" />Water - Only Show Water</p>
<li class="fire">Fire</li>
<li class="water">Water</li>
<li class="fire">Fire</li>
<li class="water">Water</li>
<li class="fire">Fire</li>
<li class="water">Water</li>
Try this instead:
Do not use live in this case it’s not necessary, use toggle instead of show and hide = less code to write ;).
And instead of
use:
It will be quicker !
Hope it was useful !