+ 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 Antworten
+ 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