Is there a way to index a specific item with a parent. For instance.
$('h4').click(function(){ alert($('div h4').index('h4')); }); <div> <p>do not include in indexing</p> <p>do not include in indexing</p> <p>do not include in indexing</p> <p>do not include in indexing</p> <h4>Tag I want to include in index</h4> <h4>Tag I want to include in index</h4> </div>
What I want from this is either a warning 0 or 1, corresponding to the h4 tag that I clicked.
Is this possible with jquery?
Update → → →
Hi guys, thanks for all the answers that most of what you guys suggested, but in working practice this doesn't seem to work. I guess I have problems somewhere else on my page.
thanks anyway
source share