如何才能让回车响应Button的Click事件
<asp:TextBox ID="txtPwd" runat="server" Width="80px" onkeydown="enterkey();"></asp:TextBox>
function enterkey()
{ try
{
if(event.keyCode==13)
{
document.getElementById("ibnLogin").click();
return false;
}
}
catch(e) {return;}
}
ibnLogin 是button的ID
我想的是 光标在txtPwd中 按下回车就触发button的点击事件
我这样写不行 请高手指点下