Javascript回车提交ajax查询的方法

html:
<form method="post" name="callForm" id="callForm">
      <input name="callee" type="text" onkeypress="if(event.keyCode==13){javascript:onSubmit()}" value="input the callee's sip uri here" maxlength="100" size="50"/>
      <input type="button" name="button" style="visibility:hidden;" id="button" onclick="alert('hello');你的ajx方法" value="button"/>
  </form>

javascript:
function onSubmit() {
    var button=document.callForm.button;
    alert(button.value);
    button.click();
}

你可能感兴趣的:(JavaScript,html,Ajax)