Answer the question
In order to leave comments, you need to log in
Can jQuery be converted to pure JavaScript?
For example, this code?
$(".hover").mouseleave(
function() {
$(this).removeClass("hover");
}
);
Answer the question
In order to leave comments, you need to log in
Can. After all , jQuery is a JavaScript library .
document.querySelectorAll('.hover').forEach(function(el) {
el.addEventListener('mouseleave', function() {
this.classList.remove('hover');
});
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question