Possible Duplicate:
jQuery attribute selector for multiple values
I have this
$('input:radio[name=foo]').change(function() {
blah();
});
$('input:radio[name=bar]').change(function() {
blah();
});
Can I do something like this?
$('input:radio[name=foo||bar]').change(function() {
blah();
});
what If I had another one?
$('input:radio[name=foo||bar||foobar]').change(function() {
blah();
});
I can't use class which would be ideal as this is a custom framework (not mine) that generates the HTML which is overriding my class. Also there is no id selector available just the name attribute. I think I'm stuck doing separate functions but wanted to pose the question to see if anyone can think outside the box on this one.
Note: this project uses jQuery 1.3.2 and I can't upgrade just yet. And before you say anything, yeah I'm with you on upgrading...