Answer the question
In order to leave comments, you need to log in
How to select all elements up to class(CSS)?
It has the following structure:
<li>1</li>
<li>1</li>
<li>1</li>
....
....
<li class="class">2</li>
<li>2</li>
<li>2</li>
Answer the question
In order to leave comments, you need to log in
Substitute the method you need, I just added a class
$('li.class', 'ul').prevAll().addClass('prev-item');
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question