Change text color on mouse hover with jQuery

We use mouseover() and mouseleave()  to change the text color. Follow the example:

//CSS style
p{
color: #000;
}

 

$('p').mouseover(function(){
    $(this).css('color', '#ff0000');
}).mouseleave(function(){
    $(this).css('color', '#000');
});

 

Was this post helpful?
Let us know if you liked the post. That’s the only way we can improve.
Yes11
No2
Harinder Singh

Harinder Singh

My name is Harinder Singh and I specialize in Software industry. I consider myself as a life learner. I love learning new concepts, embracing new ideas and reading and searching for innovation.