How to attach hover event to an element in Jquery ?

 Posted by Vivek.Ramapuram on 11/5/2014 | Category: jQuery Interview questions | Views: 735 | Points: 40
Answer:

Here in the script in coding we have to attach or we have to use hover()method to hover event to a html element in jquery.
example:


<script type="text/javascript">
$("#pHover").hover(function () { $(this).hide(500); });
</script>


This function runs and shows the output as "when user mouse over “pHover”(pHover means div id name) element,it will hide."


Asked In: spotted while learning | Alert Moderator 

Comments or Responses

Login to post response