六狼论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

搜索
查看: 136|回复: 0

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

[复制链接]

升级  82.4%

290

主题

290

主题

290

主题

进士

Rank: 4

积分
912
 楼主| 发表于 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>
您需要登录后才可以回帖 登录 | 立即注册 新浪微博账号登陆

本版积分规则

快速回复 返回顶部 返回列表