How can I apply jQuery
$('.test').each(function() { if(!$(this).children().hasClass("example")){ //your code } });
Maybe like this? I haven't tested this...