$(document).ready(function() {
$("p").hover(function() {
$(this).css("background-color", "green");
}, function() {
$(this).css("background-color", "yellow");
});
});
$(".selector").on({
mouseenter: function () {
//stuff to do on mouse enter
},
mouseleave: function () {
//stuff to do on mouse leave
}
});
//color will change to yellow on hover
//after hover it will come to white
$("span").hover(function(){
$(this).css("background-color", "yellow");
}, function(){
$(this).css("background-color", "white");
});
$( "div.enterleave" )
.mouseenter(function() {
n += 1;
$( this ).find( "span" ).text( "mouse enter x " + n );
})
.mouseleave(function() {
$( this ).find( "span" ).text( "mouse leave" );
});