Javascript examples for jQuery Method and Property:event.result
The event.result property contains the previous value returned by an event handler.
Parameter | Require | Description |
---|---|---|
event | Required. | The event parameter comes from the event binding function |
The following code shows how to Return the value of the previous click event:
<!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script> $(document).ready(function(){ $("button").click(function(){ return "Hello world!"; });/*www . j av a 2 s . com*/ $("button").click(function(event){ $("p").html(event.result); }); }); </script> </head> <body> <button>Click me to display event.result</button> <p>This is a paragraph.</p> </body> </html>