jQuery & jQuery UI Documentation

jQuery & jQuery UI

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

<!DOCTYPE html>
<html>
<head>
  <script src="http://code.jquery.com/jquery-1.7rc2.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>