jQuery | event.result Property with Examples

The event.result is an inbuilt property in jQuery which is used to find the last and previous value returned by an event handler started by the specified event.
Syntax:

event.result

Parameter: It does not accept any parameter because it is a property not a function.
Return Value: It returns the last and previous value returned by an event handler started by the specified event.

jQuery code to show the working of event.result property:

filter_none

edit
close

play_arrow

link
brightness_4
code

<html>
  
<head>
    </script>
    <style>
        div {
            width: 40%;
            height: 100px;
            margin: 10px;
            padding: 10px;
            display: block;
            border: 2px solid green;
        }
    </style>
</head>
  
<body>
    <div>
        <!-- click on this button -->
        <button>Click here for event result</button>
        <p></p>
    </div>
    <!-- jQuery code to show working of this property -->
    <script>
        $("button").click(function(event) {
            return "Geeks for Geeks !";
        });
        $("button").click(function(event) {
            $("p").html(event.result);
        });
    </script>
</body>
  
</html>

chevron_right


Output:
Before clicking the button-

After clicking the button-



My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.




Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.