Thursday, November 13, 2025
HomeLanguagesJavascriptjQuery event.result Property

jQuery event.result Property

The jQuery event.result is an inbuilt property 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. 

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

HTML




<!DOCTYPE html>
<html>
  
<head>
    <script src=
    </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:

 

Example 2: In this example, a pop-up will show last value returned by an event handler.

HTML




<!DOCTYPE html>
<html>
  
<head>
    <script src=
    </script>
</head>
  
<body>
    <center>
        <div>
            <!-- click on this button -->
            <button>Click here for event result</button>
        </div>
        <!-- jQuery code to show working of this property -->
        <script>
            $("button").click(function (event) {
                return "Geeks for Geeks !";
            });
            $("button").click(function (event) {
                alert(event.result);
            });
        </script>
    </center>
</body>
  
</html>


Output:

 

Whether you’re preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, neveropen Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we’ve already empowered, and we’re here to do the same for you. Don’t miss out – check it out now!
Dominic
Dominichttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

Most Popular

Dominic
32399 POSTS0 COMMENTS
Milvus
95 POSTS0 COMMENTS
Nango Kala
6765 POSTS0 COMMENTS
Nicole Veronica
11916 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11984 POSTS0 COMMENTS
Shaida Kate Naidoo
6889 POSTS0 COMMENTS
Ted Musemwa
7141 POSTS0 COMMENTS
Thapelo Manthata
6836 POSTS0 COMMENTS
Umr Jansen
6839 POSTS0 COMMENTS