I'm working on a tagging feature and the wrapping element for the tag (span class="tag") is showing without content. I need to hide the empty one and show the tags with content. The problem is my logic is affecting all the tags, not just the empty one. How can I target just the empty tag?
$(".tag:empty").hide();
$('.tag_btn').live('click', function() {
if (!$('.tag:empty')){
$('.tag').show();
}
});
.tag_btnthat's right next to the empty ones?$(".tag:empty").sibling('.tag_btn').hide();