Passing parameters to click() & bind() event in jQuery?

Viewed 115036

I want to pass few parameters to click() event in jQuery, I tried following but it's not working:

commentbtn.click(function(id, name){
    alert(id);
});

And also if we use bind then how we'll do that:

commentbtn.bind('click', function(id, name){
    alert(id);
});
4 Answers
Related