Using Javascript, I would like to pick up any content in a form field if a user clicks a non-form element
<p>I have a login form on an application that we cannot change the back-end of (vendor supplied), but we can change the template (ie: the html and javascript).  It has a "forgot password" link below it.  Almost all users will just click the link, but some put in their username, try a few iterations and then hit the "forgot password" link.</p>

<p>What I would like to do is use javascript to take a look at the username field and, if it has any content, change the URL of the "forgot password" link to point to the next step in the password recovery.</p>

<p>So, when the user clicks on the link with no value in the username field, the link goes to: <a href="http://example.com/system/lookup.html" rel="nofollow">http://example.com/system/lookup.html</a></p>

<p>If there is a value in the username field, I'd like the link to resolve to:
<a href="http://example.com/system/lookup.html?id=" rel="nofollow">http://example.com/system/lookup.html?id=</a>{username}</p>

<p>Easy to do?</p>
