When I hover over one element, all of them are highlighted, here is my code:
$(document).ready(function(){
$("p").hover(function(){
$("p").css("background-color","yellow");
},function(){
$("p").css("background-color","transparent");
});
I was wondering if I could highlight only one at a time instead of adding a class manually to each one
try use
$(this)insted of
use