0
Problem
I want to get him to add the attribute active
in suite-internal-item
and remove the ones you have, but it’s not working.
jQuery
$('.suite-internal-link').on('click',function(e){
e.preventDefault()
$('.suite-internal-item').each(function(e){
$('.suite-internal-item').removeClass('active')
$(this).addClass('active')
})
})
HTML
<ul class="suite-internal-items">
<li class="suite-internal-item active">
<img src="assets/images/aloha1.jpg" alt="">
</li>
<li class="suite-internal-item">
<img src="assets/images/aloha2.jpg" alt="">
</li>
<li class="suite-internal-item">
<img src="assets/images/aloha3.jpg" alt="">
</li>
</ul>
<div class="suite-internal-links">
<a href="" class="suite-internal-link">
<img src="assets/images/aloha1.jpg" alt="">
</a>
<a href="" class="suite-internal-link">
<img src="assets/images/aloha2.jpg" alt="">
</a>
<a href="" class="suite-internal-link">
<img src="assets/images/aloha3.jpg" alt="">
</a>
</div>
What is your doubt?
– Albertt Santos
I am wanting to make him adc the attribute 'active' in the class suite-Internal-item and remove the active ones that have, but it is not working
– Geniton Lima