html
<a href="home.html">Home</a>
css
a {
color: blue;
}
a:hover {
color: red;
}
now as you can see <a> now would be color red on hover.
Question
How do I remove hover via jQuery?
I have tried:
$('a').unbind('hover'); and $('a').unbind('mouseenter mouseleave')
I come to think why it won’t work, is this not hover()?
Since
a:hoveris not bound event on the anchor tag and is only a pseudo class you won’t have success unbinding the .hover() event.If you want to change the behavior then you can do two things
remove the
a:hoverstylesbind a hover event on the anchor tag and set the css accordingly.