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
sourav asked 3 weeks 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
Arben answered 3 weeks ago
Your Answer

20 + 16 =

Popular Tags

WP Facebook Auto Publish Powered By : XYZScripts.com