0
jquery (self) on mouseenter leave
Is there a better way to do this? https://code.sololearn.com/Wx6fAZKPTIW9 Instead of $("p").toggleClass("d_blue"); something like reference the div itself tex.: $(this).toggleClass("d_blue"); and leave the empty <p></p> tag in d_blue div Thanks
2 Answers
+ 10
Sorry i did not understand your question, do you mean something like this:
$("div").on("mouseleave touchend", function(){
$(this).toggleClass("d_blue");
});
... ?
0
Ok i figured it out.
https://code.sololearn.com/WK2BJs496A6V
Changed this: $("p").toggleClass("d_blue"); to this:
$(this).toggleClass("d_blue"); in function
and removed the <p></p> tag in the html
That was part of the next lesson