Get the index of specific tags using Jquery
<p>Is there a way to only index a specific element with in a parent. For example.</p>

<pre><code>$('h4').click(function(){

   alert($('div h4').index('h4'));

});

&lt;div&gt;
 &lt;p&gt;do not include in indexing&lt;/p&gt;
 &lt;p&gt;do not include in indexing&lt;/p&gt;
 &lt;p&gt;do not include in indexing&lt;/p&gt;
 &lt;p&gt;do not include in indexing&lt;/p&gt;
&lt;h4&gt;Tag I want to include in index&lt;/h4&gt;
&lt;h4&gt;Tag I want to include in index&lt;/h4&gt;
&lt;/div&gt;
</code></pre>

<p>What I want from this is either an alert of 0 or 1 corresponding to the h4 tag I have clicked.</p>

<p>Is this possible with jquery?</p>

<p>Update >>>>>></p>

<p>Hey Guys thanks for all the answers, what most of what you guys have offered works, but in working practice it doesn't seem to function. I guess I have issues somewhere else in my page. </p>

<p>Thanks Anyway</p>
