Reputation: 1791
Is this correct for an OR condition in jQuery?
$('a.clickNews' || '#footer p a:eq(2)').click(function(){
//statement
});
Thank you.
Upvotes: 2
Views: 5389
Reputation: 237865
No, that will only select 'a.clickNews'
. You need to use a comma to separate them:
$('a.clickNews, #footer p a:eq(2)').click(function(){
//statement
});
See Multiple selector in the API.
Upvotes: 7