[jQuery] Find the XPath of an element?
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<font size="-1"><font face="Helvetica, Arial, sans-serif">Hi guys
If I were to pass a P tag to $(), is there a way I could find its
location in the DOM and return an XPath expression?
For example:
xpath = $(this).getXPathLocation(); // equates to:
/html/body/div[2]/p[1]
Is this possible in the current source, or will I have to create a
recursive function to find an element's position and its parent?
</font></font>
<div class="moz-signature">--
<font color="#333333"><font size="-1"><font
face="Helvetica, Arial, sans-serif"><u><b>Phillip
B Oldham </b></u>
<small>
<b>kilo75 ltd</b>
a: Round Foundry Media Centre, Foundry St, Leeds, LS11 5QP
t: +44 (0) 870 420 2410
e: <a href="mailto:phillip.oldham@kilo75.com">phillip.oldham@kilo75.com</a>
w: <a href="http://kilo75.com/">//kilo75.com/</a>
</small></font></font>
<hr align="left" noshade="noshade" size="1" width="350"><font
color="#333333" face="Verdana, Arial, Helvetica, sans-serif" size="1"><b>Policies</b>
</font>
<font color="#333333" face="Verdana, Arial, Helvetica, sans-serif"
size="1">This e-mail and its attachments are intended for the above
named
recipient(s) only and may be confidential. If they have come to you
in error, please reply to this e-mail and highlight the error. No action
should be taken regarding content, nor must you copy or show them
to anyone.</font>
<font color="#333333" face="Verdana, Arial, Helvetica, sans-serif"
size="1">This e-mail has been created in the knowledge that Internet
e-mail
is not a 100% secure communications medium, and we have taken
steps to ensure that this e-mail and attachments are free from any
virus. We must advise that in keeping with good computing practice
the recipient should ensure they are completely virus free, and that
you understand and observe the lack of security when e-mailing us.
</font>
</font>
<hr align="left" noshade="noshade" size="1" width="350"></div>
</body>
</html>
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/