javascript回车提交表单

input type=text name="hehe" onkeydown="KeyDown()">

<script language="javascript">
function KeyDown()
{
if (event.keyCode == 13)
{
event.returnValue=false;
event.cancel = true;
Form1.btnsubmit.click();
}
}
</script>

你可能感兴趣的:(JavaScript)