How to send multiple arguments to jQuery click function?
问题 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 回答1: jQuery Events jQuery .click() $('.myclass').bind("click", { Param1: "", Param2: 2 }, function(event){ alert(event.data.Param2); }); 回答2: you