How to use hover method in jQuery

In my earlier post, I have posted about how to provide highlight effect on mouseover and mouseout using jQuery events. Today, I found another solution which is easy and compact. jQuery provide hover() event which works for both the events. It works for mouseover and it also works for mouseout. Below jQuery code uses the hover function.
$(document).ready(function(){
  $("#tblData tr").hover(function() {
    $(this).addClass('hover');
    }, function() {
    $(this).removeClass('hover');
  });
});
hover takes two arguments. First function for mouseover and second for mouseout.
See live Demo and Code
Feel free to contact me for any help related to jQuery. I will gladly help you.
SHARE

Nothing shocks me, I'm a Software Engineer. And I am not young enough to know everything. I live in World Wide Web and from there take care of this website. This website communicates about my work, learning and experience. I believe life is short, and it is for loving, sharing, learning and connecting. So lets connect..