Java script วิธีเช็ค ว่า กด Enter เข้ามาหรือเปล่า
ดัก Onkeypress
แล้วเช็คว่า key ที่ press เข้ามาเป็น Enter หรือเปล่า
โดยดักจาก key code = 13
ตามตัวอย่าง
function handle(e){
if(e.keyCode === 13){
alert("Enter was pressed was presses");
}
return false;
}