JavaScript: JQuery passing parameters into click() event handler function

From The Travis van der Font Wiki
Jump to: navigation, search
this.modal = {
    id: 'modal_123'
}

$('#test_btn1').click(
{
    id:     '#'+this.modal.id,
    action: 'hide'
},
function (event)
{
    // $('#modal_123').modal('hide');
    $(event.data.id).modal(event.data.action);
});

Additional Reference(s)