+ 4
How can use hover in JavaScript?
i wanna say while using style like that (a.style.color="red") how can i add hover in JavaScript file please help.đđ
8 Answers
+ 21
helloo
+ 4
It's called onmouseover event
+ 3
You need to use onmouseleave event to get the default styling back
+ 3
Well, if you just want to add a different color when hovering a link, just use the :hover selector to your CSS:
a:hover {
color: red;
}
Javascript on hover event is used to fire events, such as
<a href=âjavascript:void(null);â onmouseover=âjavascript:myFunction();â>Hover me</a>
But itâs used mainly in different elements, such as divs, tr, etc..
+ 1
đđđ Luigi thanks alot pal.
+ 1
No problem! đ
0
thanks alot Toni Isotalo i will try to do it.âș
0
Nina Hendra Putri hello