How can I apply jQuery
You could use the method children with ".example" and test if it is empty
$('.test').each(function() { if(!$(this).children().hasClass("example")){ //your code } });
Maybe like this? I haven't tested this...