jQuery 'Enter' and 'ESC' simulation
<p>I want to simulate a couple of clicks. A 'Save' and 'Cancel' anchor clicks.</p>

<p>I have this as my enter simulation</p>

<pre><code>$('.group').live('keypress', function(e){
    code = e.keyCode ? e.keyCode : e.which;
    if(code.toString() == 13){
        $(this).find('a.saveChanges').click();
    }

});
</code></pre>

<p>and this as my esc simulation</p>

<pre><code>$('.group').live('keypress', function(e){
    code = e.keyCode ? e.keyCode : e.which;
    if(code.toString() == 0){
        $(this).find('a.discardChanges').click(function(){
            GROUP.find('.group-text')
                .text(GROUP.data('origText'))
                .end().removeData('origText');
            GROUP.find('.groupcount').fadeIn('slow');
            GROUP.find('.group-image').fadeIn('slow');
            GROUP.removeClass('editmode');
        });
    }
});
</code></pre>

<p>My enter seems to work perfect, but my esc doesn't. I'm running this in Firefox at the moment.</p>
