I want to change the color of li which contains anchor when the mouse go over it, I make like this
Id is unique so dont repeat, u can use in class
$(document).ready(function(){ $(".son").hover(function(){ $(".sonItem").css("background-color","black"); },function(){ $(".sonItem").css("background-color","white"); }); }); son 1 son 2