How to send multiple arguments to jQuery click function?
click, jquery, parameter-passing
Solution
jQuery Events
jQuery .click()
$('.myclass').bind("click", { Param1: "", Param2: 2 }, function(event){
alert(event.data.Param2);
});
Problem
Currently I'm using something like: ``` $('.myclass').click(function(){ var msg = $(this).attr('id'); alert(msg) }); ``` And HTML: ``` < a href="#" class="myclass" id="101">Link</a> ``` If I need additional parameters how would I read them? Also is the current way I am using the proper way? Originally I was using hidden input fields so it was already a step up. :p