jQuery > Events

Hover event in jQuery

How to attach hover event to an element in jQuery?

To attach hover event to a html element, hover() method can be used. This event fires when user mouse over on the element.

       $("#pHover").hover(function () { $(this).hide(500); });

In the above code when user mouse over element having id as “pHover” element, it will hide and the hiding activity will take 500 milliseconds, we will learn about .hide() method in following posts.

 Views: 870 | Post Order: 72

Write for us