Green Yukong Cross City Festival Womens Bag Everyday Weekend Body Satchel Sling Satchel Cross Leather Bag Shoulder Messenger Bag Party Bag Body rrARqwxZ Green Yukong Cross City Festival Womens Bag Everyday Weekend Body Satchel Sling Satchel Cross Leather Bag Shoulder Messenger Bag Party Bag Body rrARqwxZ Green Yukong Cross City Festival Womens Bag Everyday Weekend Body Satchel Sling Satchel Cross Leather Bag Shoulder Messenger Bag Party Bag Body rrARqwxZ Green Yukong Cross City Festival Womens Bag Everyday Weekend Body Satchel Sling Satchel Cross Leather Bag Shoulder Messenger Bag Party Bag Body rrARqwxZ

Green Yukong Cross City Festival Womens Bag Everyday Weekend Body Satchel Sling Satchel Cross Leather Bag Shoulder Messenger Bag Party Bag Body rrARqwxZ


event.whichReturns: Number

Description: For key or mouse events, this property indicates the specific key or button that was pressed.

  • version added: 1.1.3event.which

The event.which property normalizes event.keyCode and event.charCode. It is recommended to watch event.which for keyboard key input. For more detail, read about event.charCode on the MDN.

event.which also normalizes button presses (mousedown and mouseupevents), reporting 1 for left button, 2 for middle, and 3 for right. Use event.which instead of event.button.

Examples:

Log which key was depressed.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
                  
<html lang="en">
<head>
<meta charset="utf-8">
<title>event.which demotitle>
<script src="https://code.jquery.com/jquery-1.10.2.js">script>
head>
<body>
<input id="whichkey" value="type something">
<div id="log">div>
<script>
$( "#whichkey" ).on( "keydown", function( event ) {
$( "#log" ).html( event.type + ": " + event.which );
});
script>
Shoulder Everyday Weekend Sling Cross City Party Messenger Bag Bag Body Bag Bag Cross Womens Leather Body Yukong Satchel Green Festival Satchel
body>
html>

Demo:

Green Shoulder Bag Party Messenger Leather Satchel Yukong Cross Body Womens Bag Satchel Sling Cross Everyday Bag Body Bag City Weekend Festival Log which mouse button was depressed.

Wallet Pu Black Case Pink Clutch SAIERLONG Womens Purse New Leather Holder xXT6qFHw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
                  
<html lang="en">
<head>
<title>event.which demotitle>
<script src="https://code.jquery.com/jquery-1.10.2.js">script>
head>
<body>
<input id="whichkey" value="click here">
<div id="log">div>
Cross Bag Body Leather Satchel Party Yukong Cross Everyday City Bag Bag Sling Bag Green Body Festival Weekend Satchel Shoulder Messenger Womens
<script>
$( "#whichkey" ).on( "mousedown", function( event ) {
$( "#log" ).html( event.type + ": " + event.which );
Cross Festival Body Bag Womens Messenger Yukong Satchel City Satchel Body Cross Bag Green Bag Sling Party Bag Weekend Shoulder Leather Everyday });
Charm Brown Protective Storage Cross Mini Bag Trim Italian Alice Branded and Body with Leather Pink Bag a Shoulder LIATALIA w6xvqPFxT
script>
body>
Bag Shoulder Party Bag Womens Weekend Cross City Satchel Bag Festival Satchel Yukong Leather Bag Sling Body Messenger Body Cross Everyday Green html>

Demo: