jQuery.fn.hover

by luanvuvt

HTML

<div class="box"></div>

CSS

.box {
    background: #bada55;
    width: 100px;
    height: 100px;
}

JavaScript

$('.box').hover(function () {
    $(this).css('background', 'red');
}, function () {
    $(this).css('background', '#bada55');
});