Q: How to remove a child element from a parent without affecting a DOM I have  div structure like below,
<div class="parent">
<div class="div1"></div>
<div class="div2"></div>
<div class="div3"></div>
<div class="div4"></div>

<div class="child">
<div class="div1"></div>
<div class="div2"></div>
<div class="div3"></div>
<div class="div4"></div>
</div>

</div>

i 've select the parent by var ele = $(".parent");
How do i remove a ".child" div from the "ele" variable without affecting the DOM, So that
i can query like $(".div1", ele), which will not return two .div1
Note:
The above is a simple sample example, but in my project i've very huge amount of div like div1
So i want to do operation like below,
var ele = $(".parent");
ele.each(function(){
         var g = $(this);
      var val1 = $(".div1", g);
      var val1 = $(".div2", g);
      var val1 = $(".div3", g);
      var val1 = $(".div4", g);
});

Please give me shortest solution.

A: If you change your selector to ele.children('.div1') you will only get the first .div1 that is a direct descendant of .parent
However since what you actually asked for was how to remove elements from a selector without changing the dom the answer is .not()

A: You can't do that.... you need to fine tune your selector
$(".div1:not(.child .div1)", ele)

Demo: Fiddle
or
ele.children('.div1')

Demo: Fiddle
