getting the parent element text using jquery from within a js function
<p>I would like to figure out a way to retrieve the the link text users click on from within my webapp... i'm wondering if jquery can do it.</p>

<p>Heres what a link would look like:</p>

<pre><code>&lt;span onclick="myfunction();"&gt;Link Text 1&lt;/span&gt;
</code></pre>

<p>The function "myfunction()" is located inside a .js file that gets incluced into the page</p>

<p>When the user clicks on the span tag, I would like to capture the text from the span tag that called the myfunction(), then place the text "Link Text 1" into a js variable I would then use to update my database with.</p>

<p>I know I could do this:</p>

<pre><code>&lt;span onclick="var xx = $(this).text(); myfunction(xx);"&gt;Link Text 1&lt;/span&gt;
</code></pre>

<p>But I have too many calls to this one function that rewriting the click events would be too much...i'm wondering how I can accomplish the same thing from within the "myfunction()" code using jquery to retrieve the text?</p>

<p>Any ideas?</p>

<p>Thanks in advance.</p>
