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?
});
精彩评论