jQuery search for child element, but not with certain div -


I want to stop looking for a specific child element after facing any other element.

 . DontSearchWithin ("nothere") find $ ("parent") ("children") .; Actually I want to select the elements of all children, but there are no elements of children who are within a specific diva.  

is an example

I want to select the span inside the "non-no" element.

  & lt; Div id = "parent" & gt; & Lt; Span & gt; FIND ME & lt; / Span & gt; & Lt; Span & gt; FIND ME & lt; / Span & gt; & Lt; Span & gt; FIND ME & lt; / Span & gt; & Lt; Span & gt; FIND ME & lt; / Span & gt; & Lt; Div id = "no-here" & gt; & Lt; Period & gt; Ignore & lt; / Span & gt; & Lt; Period & gt; Ignore & lt; / Span & gt; & Lt; Period & gt; Ignore & lt; / Span & gt; & Lt; / Div & gt; Apart from this, there may be more child elements in it and this period will be originally intended for parents directly to children. Children of the basic element can be children of children of children if it makes senseness   

You can only "spin-override"> $ span = $ (' # Parent '). Search ('span'). No ('# no- here period'); Spans.css ('color', '# f90');

  & lt; Script src = "https: //ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js" & gt; & Lt; / Script & gt; & Lt; Div id = "parent" & gt; & Lt; Span & gt; FIND ME & lt; / Span & gt; & Lt; Span & gt; FIND ME & lt; / Span & gt; & Lt; Span & gt; FIND ME & lt; / Span & gt; & Lt; Span & gt; FIND ME & lt; / Span & gt; & Lt; Div id = "no-here" & gt; & Lt; Period & gt; Ignore & lt; / Span & gt; & Lt; Period & gt; Ignore & lt; / Span & gt; & Lt; Period & gt; Ignore & lt; / Span & gt; & Lt; / Div & gt;             / div>  

Comments

Popular posts from this blog

winforms - C# Form - Property Change -

javascript - amcharts makechart not working -

java - Algorithm negotiation fail SSH in Jenkins -