开发者

How can i track what the users type without a input field? (jQuery)

All that the user is typing must be inserted to a div instead of a input field or a textarea.

Btw. the user don't have to click anywhere to start typing, the user can just do it without any action.

开发者_开发百科

Sorry if it isn't understandable. (I'm not very good at english).

Thanks in advance.


Each key is associated with a keycode:

$(window).bind("keypress", function(e) {
  var code = (e.keyCode ? e.keyCode : e.which); // which code?
  alert(String.fromCharCode(code)); // which key, according to the code?
});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜