问题描述
我想使用enter键使用jquery读取asp.net中的文本框内容。我使用以下代码从生成运行时的文本框中读取id:
function showkey(id){
var keycode =(event.keyCode?event.keyCode:event.which);
if(keycode == 13){
alert ('你按下回车键');
}
}
此代码在chrome和IE中运行,但在firefox中不运行。
请建议任何解决方案
I want to use enter key to read text box content in asp.net using jquery. I have used the following code to read "id" from the textbox that is being generated runtime:
function showkey(id) {
var keycode = (event.keyCode ? event.keyCode : event.which);
if (keycode == 13) {
alert('You pressed enter key');
}
}
This code is running in chrome and IE but not in firefox.
Please suggest any solution
推荐答案
这篇关于如何使用Jquery读取输入密钥代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!