jQuery - click on button shown on focusin
<p>I want to show a button on focusin, do some action when clicked or hide that button on focusout:</p>

<pre><code>$(".editableDiv").live('focusin', function(){
    // show button under the .editableDiv div

    $("#button").live('click', function(){
        // do action
    });
    $(".editableDiv").live('focusout', function(){
        // hide button
    });
});
</code></pre>

<p>It shows the button on focus but when the button is clicked, the action is ignored and the button is immediately hidden like if focusout had priority over click. When I try to remove that focusout part, the action gets done but button stays visible... but I need to hide that button on focusout.</p>

<p>It seems so simple... but I cannot figure out why it's not working - any hint would be appreciated.</p>
