parseInt(key.which, 10)


Hello, I understand the switch cases etc.. but i don't know what the key.which, 10 is doing.
I would like clarification on it please

$(document).ready(function() {
    $(document).keydown(function(key) {
        switch(parseInt(key.which,10)) {


key is the event object.

For the event object of keydown event, property which indicates the specific key that was pressed.

You can read more about event objects and their properties in the documentation.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.