jQuery hover event

jQuery hover event example for COMP1021

by scsswil

HTML

<p>Hover the mouse over the paragaph</p>

JavaScript

$(document).ready(function() {
  $("p").hover(function() {
    $(this).css("background-color", "#1212ee");
  }, function() {
    $(this).css("background-color", "#ee1214");
  });
});