shirlly 发表于 2013-2-7 19:47:34

输入框中按回车触发提交事件

html代码
<input id="webchat_usersend" type="text" height="20" size="65" maxlength="255" value="请在此输入您要说的话" onKeyDown="webchat_chkkeysend(event);" /> <input type="button" value="发送"/>
JS代码
<script language="javascript">function webchat_chkkeysend(event){   if (event.keyCode==13) {webchat_sendmsg();}}</script>
页: [1]
查看完整版本: 输入框中按回车触发提交事件