Return XPath location with jQuery? Need some feedback on a function
<p>For the following project I will be using PHP and jQuery.</p>

<p>I have the following code:</p>

<pre><code>$('*').onclick(function(){

});
</code></pre>

<p>Once a user clicks on an element I want it to return the XPath location of that element.</p>

<p>What I want to do essentially is sort of a filtering system with a little help of jQuery.</p>

<p>PHP will retrieve a document from an outside source with PHP, using jQuery a user click on an element/relevant parts of that document. This jQuery function will return the XPath location of where the user clicked and is stored and associated with that document.</p>

<p>In the future if that document is updated, using the XPath, PHP will retrieve only the XPath that was selected by the user previously instead of the whole document.</p>

<p>I will need this jQuery function to also return element attributes such as the title in a <code>&lt;p&gt;</code> or href location in an anchor link.</p>

<p>Long story short: My question is, is this even possible in jQuery? Returning the XPath location of a selected element along with it's attributes? I have no idea what this would look like in jQuery so any help would be appreciated.</p>

<p>Any other additional feedback would be great too. As far as I know I could be using the wrong tools... or something. Thanks.</p>
