tags:

views:

39

answers:

1

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.

+2  A: 

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?
});
Jonathan Sampson
Cool, thank you very much.
Mikkel
How can i see if they are typing uppercased letters?
Mikkel
By examining the code: lowercase 'j' is 106, while uppercase 'J' is 74.
Jonathan Sampson
Of course, stupid me :PThanks :D
Mikkel
How can i track if the user use the backspace button?
Mikkel