I have a slight issue where i need to count nest level of elements.
Problem is that parent element can hold multiple child elements and child elements can have their own child elements.

Please see from where i want to start count (marked with text "I start here").

HTML:

&lt;div class="main_set"&gt;
    &lt;div class="child_set"&gt;
        &lt;div class="child_set"&gt;
            &lt;div class="child_set"&gt;I start here!&lt;/div&gt;
        &lt;/div&gt;
        &lt;div class="child_set"&gt;&lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="child_set"&gt;
        &lt;div class="child_set"&gt;&lt;/div&gt;    
    &lt;/div&gt;
&lt;/div&gt;


I have tried couple things to get count 3.
For example my last attempt:

$(this).closest('.main_set').find('.child_set');


This one obviously returns 6 tho counting all child_sets.

How to count child_set elements from start place to main_set taking into account only nesting. So basically in my example how to get count 3?


Question: Word-order and meaning - which is correct for this notice?
Answer: I'd say, stating it in a clearer way would be better:


  10am - 4pm access only. No parking during this time.