Q:

add a div.class in a child, only when the parent does not have other div.class

i have a html code like this:
<div class="someclass">
    <div class="childclass"></div>
    <div class="checkclass"></div>
</div>
<div class="someclass">
    <div class="childclass"></div>
</div>
<div class="someclass">
    <div class="childclass"></div>
    <div class="checkclass"></div>
</div>
<div class="someclass">
    <div class="childclass"></div>
    <div class="checkclass"></div>
</div>
<div class="someclass">
    <div class="childclass"></div>
</div>

and i need to add a div only on those divs that dont have that "checkclass", so it will like this:
<div class="someclass">
    <div class="childclass"></div>
    <div class="checkclass"></div>
</div>
<div class="someclass">
    <div class="childclass"></div>
    <div class="newclass"></div>
</div>
<div class="someclass">
    <div class="childclass"></div>
    <div class="checkclass"></div>
</div>
<div class="someclass">
    <div class="childclass"></div>
    <div class="checkclass"></div>
</div>
<div class="someclass">
    <div class="childclass"></div>
    <div class="newclass"></div>
</div>

i tried with jquery something like:
$('.someclase:not(children(hasClass(checkclass))').append('<div class="newclass"></div>');
$('.someclass:not(:children(.checkclass))').append('<div class="newclass"></div>');
$('.someclass > :not(.checkclass)').append('<div class="newclass"></div>');

but still nothing, any ideas?

A:

Try something like:
$(".someclass").each(function(){
    if(!$(this).find(".checkclass").length)
    {
        $(this).append("<div class='checkclass' />");
    }
});

What you tried is getting all elements that not have the checkclass class. Not the DIV's that don't have a child with checkclass.

