Suppose there are some pictures. They all have the attribute rel = "smth". They do not go abreastly, they can be in different tables, divs, etc .. So .next will not roll. How can they be selected in turn?

  • try wrapping them in class - Gorets
  • And the example is possible? I am quite mediocre about jQuery ... - oleg_ismaylov
  • =) Yes, I am only a theoretician =) I don’t know anything else, I don’t know anything, I don’t do anything =) just the class will allow you to combine a group of elements into one, and go - to distinguish them in a group - Gorets

2 answers 2

$("[rel = 'smth']") - должен выбрать все объекты у которых атрибут rel=smth 
  • Thank you, we will try ... - oleg_ismaylov

there is another way:

 $('*').filter('[rel=smth]');