This one has me stumped.
<div id="container">
<div id="store"></div>
<div id="contact"></div>
</div>
I'm looking for the contact divs position as child of "container". So just to be extra clear, if i'm looking for 'contact's position, i need jquery to return the number 1.
any help is greatly appreciated! thanks!
You could try something like:
$('#contact').prevAll('div').length + 1
as in get the length of previous div siblings. Omit the +1 if you want a zero-based index.