jQuery เช็คเคาะ enter ด้วย keypress 13
ตัวอย่าง function เช็ค event การเคาะ enter ด้วย jQuery
ลองใช้งานกันดูนะครับ
$("#ba_input").keypress(function(e) {
if(e.which == 13) {
alert('Enter !!!!!!');
}
});
ตัวอย่าง function เช็ค event การเคาะ enter ด้วย jQuery
ลองใช้งานกันดูนะครับ
$("#ba_input").keypress(function(e) {
if(e.which == 13) {
alert('Enter !!!!!!');
}
});
#1. เอก
↓ @ 007 เป็นตัว selector ที่เราเลือกครับ ตามตัวอย่างก็คงจะเป็น เมื่อมีการ key enter ของ input ที่มี id = ba_input ............................................... |