jquery .empty() conflict with keypress event
<p>This is meant to allow a user to type in a message and then press enter to send it. This should clear the box so that the user can type in a new message. The problem is that the standard result of pressing enter (creation of a newline) is occurring <em>after</em> the .empty() event....so the text vanishes and is replaced by a newline, which is quite undesirable. How can I circumvent this?</p>

<pre><code>  $('#messagebox').keypress(function(event) {
        if (event.keyCode == '13') {
            send();
            $('#messagebox').empty();
        }
    }); 
</code></pre>
