I want to create a hover effect that highlights all elements on a page with the same class.
This is the code I currently have:
$(document).ready(function () {
$('p.myclass').mouseover(function () {
$(this).addClass('hover');
});
$('p.myclass').mouseout(function () {
$(this).removeClass('hover');
});
});
Here is my example on JSFiddle
At the moment, only the element being hovered over gets highlighted. Is there a way to make it highlight ALL elements with the same class? I'm open to using either CSS3 or jQuery to achieve this.