สถานที่ทั่วไปคือ: กด Enter เพื่อส่งข้อมูลแบบฟอร์มซึ่งเหมือนกับปุ่มคลิก
<formName = form1Method = postAction =>
<inputType = textName = ชื่อผู้ใช้> <br>
<inputType = buttonValue = คลิก onclick = javaScript: s2 ()>>
</form>
<script>
document.onkeydown = function () {ss ()}
ฟังก์ชั่น ()
-
if (event.keycode == 13)
-
การแจ้งเตือน (form1.username.value);
-
-
ฟังก์ชั่น 2 ()
-
การแจ้งเตือน (form1.username.value);
-
</script>