Jquery open url as a variable and change text
<p>I have this:</p>

<pre><code>&lt;fieldset id="social_associations" class=""&gt;
    &lt;a href="/social/login/twitter"&gt;Associate your account to twitter&lt;/a&gt;
    &lt;br&gt;
    &lt;a href="/social/login/facebook"&gt;Associate your account to facebook&lt;/a&gt;
    &lt;br&gt;
&lt;/fieldset&gt;
</code></pre>

<p>And I would like a function to follow the URLs within these links but these URLs are generated by a script and may change according to the user's profile (if a user has already associated an account then the URL that will appear will have 'disconnect' instead of 'login') so the function must take whatever appears in the link, it can't be hardcoded. I don't want to leave the current page while clicking on it. And when a link is clicked I would like to change the text from associate... to disconnect. Must be easy but I have no clue!</p>

<p>EDIT:</p>

<p>I understand that the question is not clear so I rephrased it here:
<a href="http://stackoverflow.com/questions/10494835/javascript-on-click-change-href-and-open-in-new-window">javascript on click change href and open in new window</a></p>
