I would like to do an onhover to add a class that activates an animation effect on the object to which I throw it, but I can't, this is what I have.
I have an array of <a>
which have class anchor-lbl , I used something similar to assign a class to all of them, but now I want to assign a class to them. I guess I need something similar
! function() {
var x = document.getElementsByClassName("lbl2");
var i;
for (i = 0; i < x.length; i++) {
x[i].classList.add('animated', 'bounceInLeft');
}
}();
! function() {
$(".lbl2").mouseover(function() {
$(this).removeClass('bounceInLeft');
$(this).addClass('bounce');
}).mouseout(function() {
$(this).removeClass('bounce');
});
}();
<label class="lbl">Monto Crédito </label>
<a class="anchor-lbl" href="#">
<h3 class="lbl2">$7,000.00 hasta $60,000.00</h3>
</a>
<label class="lbl">Plazo Mínimo </label>
<a class="anchor-lbl" href="#">
<h3 class="lbl2">3.5 Meses</h3>
</a>
<label class="lbl">Plazo Máximo </label>
<a class="anchor-lbl" href="#">
<h3 class="lbl2">18 Meses</h3>
</a>
I've edited my question to what I have so far, I don't have any errors in console, but also no effect when doing my hover
In your code I can see that you are using jQuery , so why not use it for everything ? Instead of using native JavaScript you should use the utilities that jQuery offers to do this type of thing more easily.