Consider the following markup:
<div class="body">
<p>...<p>
<p>...<p>
<blockquote>
<p>...<p>
</blockquote>
<p>...<p>
<p>...<p>
</div>
I want to select the first <p>
element. I can do this with:
$( ".body p:nth-child(1)
However if I wanted to select the 3rd
(excluding the blockquote) this will not work:
$( ".body p:nth-child(3)
I tried using nth-type, but if I do:
$( ".body p:nth-type(1)
It will select the first
in the body and also the nexted p in block quote.
I need to be able to exclude or ignore the blockquote. Would it work if I read the dom ino a variable and removed the blockquote before calling nth-child?