Javascript examples for jQuery Method and Property:bind
Bind with data and 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(e){//from w w w . ja v a 2s .c o m console.log(e.data.msg); } $(document).ready(function(){ $("p").bind("click", {msg: "You just clicked me!"}, handlerName) }); </script> </head> <body> <p>Click me!</p> </body> </html>