Using JQuery to get string value of an onclick() event
<p>Wondered if there was good way to do this, thought I would post to the SO community...</p>

<p>There is a 3rd party web page that I have no control over how it renders, but they allow me to add JQuery.</p>

<p>Using the JQuery, I am creating a nav menu on the side of the page, it will be a list of links.  The onclick event of these links I get from existing onclick events already on the page, but when I do a:</p>

<pre><code>var linkLoc = $('#theLink').attr("onclick");
</code></pre>

<p>linkLoc returns:</p>

<pre><code>function onclick(event) {
  handleJumpTo("com.webridge.entity.Entity[OID[E471CB74A9857542804C7AC56B1F41FB]]", "smartform");
}
</code></pre>

<p>instead of what I would expect:</p>

<pre><code>handleJumpTo("com.webridge.entity.Entity[OID[E471CB74A9857542804C7AC56B1F41FB]]", smartform");
</code></pre>

<p>I think JQuery is trying to get the event for binding, but I need the <em>actual Javascript markup</em> since I'm creating the HTML dynamically.  I guess I could substring the "function onclick(event) {" out, but seems kind of hacky.</p>

<p>Any ideas of an elegant way I could get the onclick markup?</p>
