$('#check1,#check2').click(function() {
});
Live above,how to tell if "check1" or "check2" is clicked ?
$('#check1,#check2').click(function() {
});
Live above,how to tell if "check1" or "check2" is clicked ?
On event handler functions, the context (the this keyword) within the function, represents the HTML Element that triggered the event.
You can:
$('#check1,#check2').click(function() {
var id = $(this).attr('id'); // or simply this.id
});
Inside your function you can get the ID of the element and compare..
if($(this).attr("id") == "check1") ...