event.result

jQuery

event.result


event.result Returns: Object

Description: The last value returned by an event handler that was triggered by this event, unless the value was undefined.

  • version added: 1.3event.result

This property can be useful for getting previous return values of custom events.

Example:

Display previous handler's return value

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
                                  
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-latest.js"></script>
</head>
<body>
<button>display event.result</button>
<p> </p>
<script>
$("button").click(function(event) {
return "hey";
});
$("button").click(function(event) {
$("p").html( event.result );
});
</script>
</body>
</html>