getting the contents of a function in an `onclick` attribute in my html with jQuery
<p>What?!  I know, what a bad idea. </p>

<p>Firstly I have no control over the html that was output, its from a vendor and it is produced via their crazy system that our company has an agreement with. (let's not talk about the situation, I know it's not optimal)</p>

<p>In the html I have:</p>

<pre><code>&lt;a id="notify" onclick="location.href='index.php?foo=bar';return false;" href="javascript:;"&gt;Notify!&lt;/a&gt;
</code></pre>

<p>In my JS If I do:</p>

<pre><code>console.log($("#notify").attr("onclick"))
</code></pre>

<p>I recive:</p>

<pre><code>onclick(event)
</code></pre>

<p>Which makes sense, but I need to change the onclick's attribute, so it reads to something like:</p>

<pre><code>onclick="location.href='index.php?foo=bar&amp;zoobazz=moo';return false;"
</code></pre>

<p>better yet, if I could remove the onclick and replace the href attributes value with location.href.</p>
