My question is quite simple with an example:

<div id="mymenu">
 <ul>
  <li><a id="link_x" href="#">label X</a></li>
  <li><a id="link_y" href="#">label Y</a></li>
  <li><a id="link_z" href="#">label Z</a></li>
  <li><a id="link_w" href="#">label W</a></li>
 </ul>
</div>

I would like to know the index of the <li> tag containing the
hyperlink with id "link_y" : in this example, it should be 1, but if
for any reason I re-order the links, alphabetically for example, it
should become 2.

Thanks for your help!

-- J:o)

Reply via email to