I am using a slider (Slick Slider) and I am trying to target individual slides.
Here is an example of the things it spits into the divs.
<div class="slick-slide" data-slick-index="1" aria-hidden="true" tabindex="-1" role="option" aria-describedby="slick-slide01"></div>
<div class="slick-slide" data-slick-index="2" aria-hidden="true" tabindex="-1" role="option" aria-describedby="slick-slide02"></div>
I want to target each div using jQuery so I can add a class to it. I think the attribute I want to target is aria-describedby
I've tried doing this:
jQuery("[aria-describedby='slick-slide01']").addClass("newClass"); but it doesn't seem to work.
I can't use nth child selectors because I have Slick set to infinite loop and nth child on this doesn't always select the right div. What can I try next?