lundi 25 juillet 2016

Jquery combine click and change

Is it possible listen click and change for one code?

$(document).on("click", "button.options_buy",function(event) {

//   same code
}


$(document).on("change", "select.options_buy",function(event) {

//   same code
}

I try this

$(document).on("click change", "button.options_buy,select.options_buy",function(event) { }

It works but I want 'click' only for 'button.options_buy' and 'change' for 'select.options_buy'

is it possible?

Aucun commentaire:

Enregistrer un commentaire