Combining keycode events in jQuery
问题 I'm building a virtual keyboard in jQuery, using keycode events to tigger an append, but keycode combinations are throwing me for a loop. Here's an example: I want to append a questionmark only when both the SHIFT key (keycode 16) and slash key (keycode 191) are pressed together. I thought the && operator would help, but this only appends the slash: $(document).keydown(function(e) { if (e.keyCode == 16 && e.keyCode == 188 ) { $('#mydiv').append('<span>?</span>'); } }); Any suggestions or idea