Alex Rivera | Logout

jQuery: select an element's class and id at the same time?

Asked 2009-12-22T05:20:02.473
195

I've got some links that I want to select class and id at the same time.

This is because I've got 2 different behaviours. When a class of links got one class name they behave in one way, when the same clas of links got another class name they behave differently. The class names are switch with jquery.

So I have to be able to select a links class AND id at the same time. Is this possible?

I've tried:

 $("a .save #country")

without any result.

Edit
Report

1 Answer

4
$("a.save, #country") 

will select both "a.save" class and "country" id.

answered 2009-12-22T05:22:29.760

Your Answer