当前位置: 动力学知识库 > 问答 > 编程问答 >

javascriptmvc - JavasctiptMVC keypress event

问题描述:

My work in JavascriptMVC is capturing the enter press event and i have steal ('jquery/event/key') plugin and my code is

'input keypress': function(ev){

alert("inside");

alert(ev.key());

if(ev.key() == '\r') {

alert("enter");

}

},

but it doesn't work in firefox itself my first alert('inside') is working but after that it says "ev.key() is not a function". Can anyone help me

网友答案:

What object is ev? Isn't 'key' a property instead? Maybe this will help How to detect pressing enter on keyboard using jquery?

分享给朋友:
您可能感兴趣的文章:
随机阅读: