We have the following html:
<div>
<div class="bord" id="1">
parent1
<div class="bord">
child1
<div class="bord">
subchild1
</div>
</div>
</div>
</div>
-----------
<span>
<div class="bord" id="2">
parent1
<div class="bord">
child1
<div class="bord">
subchild1
</div>
</div>
</div>
</span>
need to have function that will select with call
a=$('.bord').new_function();
only elements marked in sample as id=”1″ and id=”2″;
if after that:
b=a.new_function();
it should select child1s only
b.new_function();
should be able to select subchild1s
I tried several ways and have no ideas now.
Solved myself: http://jsfiddle.net/oceog/3pGXv/
HTML:
JS: