There is dynamically build Html block with some elements having attribute input-readonly-container. I need to select elements which are not in sub input-readonly-container.
<div id='root' input-readonly-container>
<input id='1' type="text" />
<input id='2' type="text" />
<input id='3' type="button" value="Btn"/>
<div id="child1" input-readonly-container>
<input id='5' type="text"/>
<input id='6' type="text"/>
</div>
<div id="child2">
<input id='7' type="text"/>
<input id='8' type="text"/>
</div>
</div>
In this sample I need to select only elements with Id 1,2,3,7,8. Child container with [input-readonly-container] and internal elements (5,6) should be skipped.
Selection should happen inside of context of root element.
var root=$('#root');
$('selectorHere', root);
and this should select only id=1,2,3,7,8.
If child doesn't have [input-readonly-container], selection should pick all children elements (7,8)
If I run same selector with root=$('#child'), it should select id=5,6 only
So idea of selector to select elements of container with [input-readonly-container] which are not children of another element with attribute [input-readonly-container]