I have a few elements like below:
<a class="slide-link" href="#" data-slide="0">1</a>
<a class="slide-link" href="#" data-slide="1">2</a>
<a class="slide-link" href="#" data-slide="2">3</a>
How can I add a class to the element which has a data-slide
attribute value of 0
(zero)?
I have tried many different solutions but nothing worked. An example:
$('.slide-link').find('[data-slide="0"]').addClass('active');
Any idea?
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…