How to implement the selection of multiple items by id?
There are several id types:
#best-id-N
where N is the number. From 1 to 20, for example.
All of them default to the CSS class "best class".
And you must do the following:
If the pointer is over a 13th element, then all previous (1 to 13) elements need to add new CSS class "best-class-for-item".
Did you add this class to the element that the cursor is on, and here's how to make the items to him - I don't know.
Help, please.
2 answers
Learn N from this id and use the same N in a loop:
for (var i = 1; i <= N; i++) { ... }
Find more questions by tags jQuery