jQuery .focusOut() conditional action dependent on next selected element
<p>I have a table cell with a text input <code>#usernameInput</code> and a link <code>#saveLink</code>. Using jQuery I have a function assigned to the  click event of the <code>#saveLink</code>. </p>

<p>What I'm trying to acheive is, When the <code>#usernameInput</code> loses focus I want to hide it. Unless it loses focus to the <code>#saveLink</code>.
In other words, if the user click anywhere other than the <code>#saveLink</code> I want to hide the <code>#usernameInput</code> otherwise call the click event on the <code>#saveLink</code>.</p>

<p>I have no problem handleing the <code>$('#usernameInput').focusout()</code> but I cant get it to detect if the save link was clicked. </p>

<p>Here is what i have so far. </p>

<pre><code>&lt;script type="text/javascript"&gt;

$('#usernameInput').focusout(function ()
{

    if (!$('#saveLink').is(':focus'))
    {
        $('#usernameInput').hide();
    }
    return;

});&lt;/script&gt;
</code></pre>
