Skip to content
Related Articles

Related Articles

Improve Article
jQuery | event.result Property with Examples
  • Last Updated : 12 Feb, 2019

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:




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

Output:
Before clicking the button-

After clicking the button-




My Personal Notes arrow_drop_up
Recommended Articles
Page :