jQuery API

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-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>

Demo:

Support and Contributions

Need help with event.result or have a question about it? Visit the jQuery Forum or the #jquery channel on irc.freenode.net.

Think you've discovered a jQuery bug related to event.result? Report it to the jQuery core team.

Found a problem with this documentation? Report it to the jQuery API team.

* All fields are required
  • adam1920

    Hello,
    this example not working. Please, insert “p” tag into body before script block.