Note that there are some explanatory texts on larger screens.

plurals
  1. POFind deeply nested input by jquery
    primarykey
    data
    text
    <pre><code> &lt;div id="customerServices"&gt; &lt;div id="pnlCustomerServices_Container"&gt; &lt;!-- and many others divs...... --&gt; &lt;div id="s1_Container"&gt; &lt;div id="ext-gen32"&gt; &lt;!-- and many others divs........ --&gt; &lt;input type="checkbox" id="s1" name="s1" class=" x-form-checkbox and_many_classes..... parent" value="s1"&gt; &lt;label for="s1" class="x-form-cb-label font-bold" id="ext-gen33"&gt;Label1Text&lt;/label&gt; &lt;!-- and many others divs........ ---&gt; &lt;/div&gt; &lt;/div&gt; &lt;div id="s2_Container"&gt; &lt;div id="ext-gen33"&gt; &lt;!-- and many others divs........ --&gt; &lt;input type="checkbox" id="s2" name="s2" class=" x-form-checkbox and_many_classes..... parent" value="s2"&gt; &lt;label for="s2" class="x-form-cb-label font-bold" id="ext-gen34"&gt;Label1Text&lt;/label&gt; &lt;!-- and many others divs........ ---&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>I want to find all <code>input checkBox</code> (in this case <code>input checkBox id="s1"</code> and <code>input checkBox id="s2"</code>) that have the attribute class contains "parent" <strong>and nested inside</strong> <code>div id="customerServices"</code>. </p> <p>But the difficult is it's unknown how many divs are between <code>customerServices</code> and <code>input class = "parent"</code> and how many values has input's attribute class.</p> <p><strong>update</strong>: some time ago I was using the following code. But it doen't work for the current task.</p> <pre><code>$('#customerServices input:checkbox[class="parent"]'); </code></pre> <p><strong>update2:</strong> And one more thing. How can I find the checkBox which doesn't have attribute <code>class=parent</code></p> <pre><code> $('#customerServices input:checkbox[class^="parent"]') </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload