Link for all dot net and sql server video tutorial playlists https://www.youtube.com/user/kudvenkat/playlists?sort=dd&view=1 Link for slides, code samples and text version of the video http://csharp-video-tutorials.blogspot.com/2015/04/passing-data-to-event-handler-in-jquery.html Healthy diet is very important both for the body and mind. If you like Aarvi Kitchen recipes, please support by sharing, subscribing and liking our YouTube channel. Hope you can help. https://www.youtube.com/channel/UC7sEwIXM_YfAMyonQCrGfWA/?sub_confirmation=1 In this video we will discuss how to pass data to the event handler function in jQuery The following example, 1. Binds the click event handler to the button using on function 2. We are passing 3 arguments to the on() function a) The name of the event b) JSON object that contains data that we want to pass to the event handler c) Event handler method name 3. In the event handler method (sayHello), we access the data using event object's data property. Replace < with LESSTHAN symbol and > with GREATERTHAN symbol <html> <head> <title></title> <script src="jquery-1.11.2.js"></script> <script type="text/javascript"> $(document).ready(function () { $('#btnClickMe').on('click', { firstName: 'John', lastName: 'Doe' }, sayHello); $('#btnClickMe').on('click', { firstName: 'Mary' }, sayHello); $('#btnClickMe').on('click', sayHello); function sayHello(event) { if (event.data == null) { alert('No name provided'); } else { alert('Hello ' + event.data.firstName + (event.data.lastName != null ? ' ' + event.data.lastName : '')); } } }); </script> </head> <body style="font-family:Arial"> <input id="btnClickMe" type="button" value="Click Me" /> </body> </html> Output : Hello John Doe Hello Mary No name provided

jquery pass event data to functionjquery passing event datajquery pass data to event handlerjquery pass data to functionjquery pass data to clickjquery pass event data using on methodjquery pass event data using on functionjquery tutorialjquery tutorial for beginners