Try to search your question here, if you can't find : Ask Any Question Now ?

Trying to change UL LI background color jquery

HomeCategory: stackoverflowTrying to change UL LI background color jquery
Avatarsourav asked 5 months ago

I am trying to change the clicked UL LI link with jquery; it only works with hover event, not with click event. Please see my code below:

$("nav ul li").hover(function() {
    $(this).find('a').css('color', '#FF0');
}, function() {
    $(this).find('a').css('color', '#FFF');
});

$("nav ul li").click(function() {
    $(this).find('a').css('color', '#FF0');
    $(this).find('a').siblings().css('color', '#FFF');
});
1 Answers
Best Answer
AvatarArben answered 5 months ago
Your Answer

16 + 2 =

Popular Tags

WP Facebook Auto Publish Powered By : XYZScripts.com