js 监听按键 回车 13 删除 8
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Document</title> <script src="http://cdn.bootcss.com/jquery/1.11.1/jquery.min.js"></script> </head> <body> <input type="text" name="search_input" id="search_input"> <script> //删除键事件绑定 $('#search_input').bind('keyup', function(event) { if (event.keyCode == "8") { alert('你按了删除键'); } }); </script> </body> </html>