Reputation: 6176
could you please tell me if it's possible de use a selector like that :
$(s_li, '#tools')
s_li is a variable, and '#tools' is the selector, i'd like to bind an event to both of those targets. My exemple doesn't work, do you any idea?
Thanks a lot.
Upvotes: 0
Views: 532
Reputation: 186063
If s_li is a selector string:
$(s_li + ', #tools')
If s_li is a reference to a DOM element:
$(s_li).add('#tools')
Upvotes: 8
Reputation: 933
You can do $('#selector1, #selector2')...
http://api.jquery.com/multiple-selector/ For more detail.
Upvotes: 0