Quick onkeyup function
<p>I am using onkeyup function in a textbox to make a button click but when I click on enter first on TextBox cursor moving to next line and then <code>onkeyup</code> function is taking place. For perfection in my project I need quick onkeyup function where cursor should not go down and function should take place. Just like StackOverflow's comment TextBox.</p>

<p>I am using following code:</p>

<pre><code>&lt;asp:TextBox ID="inputmess" runat="server" TextMode="MultiLine" Height="70px" Width="495px" onkeyup="if (event.keyCode == 13) document.getElementById('sendmess').click()" /&gt;
</code></pre>
