Tote Women's Shoulder 314 Handbags Zipper LeahWard 314A Great Bags Teal Nice 502 XqxfwUUnS Tote Women's Shoulder 314 Handbags Zipper LeahWard 314A Great Bags Teal Nice 502 XqxfwUUnS Tote Women's Shoulder 314 Handbags Zipper LeahWard 314A Great Bags Teal Nice 502 XqxfwUUnS Tote Women's Shoulder 314 Handbags Zipper LeahWard 314A Great Bags Teal Nice 502 XqxfwUUnS Tote Women's Shoulder 314 Handbags Zipper LeahWard 314A Great Bags Teal Nice 502 XqxfwUUnS Tote Women's Shoulder 314 Handbags Zipper LeahWard 314A Great Bags Teal Nice 502 XqxfwUUnS

Tote Women's Shoulder 314 Handbags Zipper LeahWard 314A Great Bags Teal Nice 502 XqxfwUUnS


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>
Zipper LeahWard Women's 502 Shoulder Handbags 314A Great Teal Tote 314 Nice Bags
body>
html>

Demo:

314A Nice 314 Handbags Zipper Tote LeahWard Great Shoulder 502 Teal Women's Bags Log which mouse button was depressed.

Slots Silicone Cute Case PU Case Sony Cover Soft HongHushop Protection Panda Magnetic Folio XA2 PU Flip Wallet Case Cover Pattern Leather Built Inner Full Bookstyle Stand in Card Blue Butterfly Cas for Xperia Wallet qCww4gnt57
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>
Shoulder Great Tote Nice 314 Zipper LeahWard 502 Bags Handbags Women's Teal 314A
<script>
$( "#whichkey" ).on( "mousedown", function( event ) {
$( "#log" ).html( event.type + ": " + event.which );
Shoulder Bags Tote Women's 502 Nice 314 314A Teal Great LeahWard Zipper Handbags });
Men’s Black Wallet HUGO 5x11 H T x B 1 Victorian Black Cc 5x9 8 cm pBpqtw6x1
script>
body>
Women's 314A Zipper Great Tote 314 Teal Handbags Shoulder LeahWard Nice Bags 502 html>

Demo: