Javascript examples for jQuery Method and Property:on
Pass data to event handler
<!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script> function handlerName(event) {/*from w w w .j a v a 2 s . c o m*/ console.log(event.data.msg); } $(document).ready(function(){ $("p").on("click", {msg: "hi!"}, handlerName) }); </script> </head> <body> <p>Click me!</p> </body> </html>