jQuery
[jQuery] input 엔터키 이벤트 - event.which
힘없는염소
2016. 1. 20. 14:34
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | <!DOCTYPE html> <html lang="ko"> <head> <meta charset="utf-8"> <script src="js/jquery.js"></script> </head> <body> <input type="text" name="" value="" /> <script> // input enter keydown event $("input").keydown(function (event) { if (event.which === 13) { //enter console.log($(this).val()); } }); </script> </body> </html> |
반응형