Reputation: 14165
if I have multiple elements which are wire certain function like
$('#one').change(function () {
myFun();
});
$('#two').change(function () {
myFun();
});
how can I do this with inline statement, I tried with
$('#one', '#tow').change()...
but that obviously doesn't work.
Upvotes: 1
Views: 42
Reputation: 77502
For several selectors you can use comma (,
), like this
$('#one, #tow').change()
Upvotes: 4