$("p").mouseenter(function() { $(this).css("backgroundColor", "red"); }).mouseleave(function() { $(this).css("backgroundColor", "blue"); })