Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6544125
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:25:43+00:00 2026-05-25T11:25:43+00:00

I have a navigation menu within a .navContainer css div. Upon click, one of

  • 0

I have a navigation menu within a .navContainer css div. Upon click, one of the li tags within the ul tag’s text changes colour. However I would like to know how, using jquery, I can keep the colour of the currently selected navigation item and change the colour of the currently hovering item #d49a9a until the user clicks and the colour on the currently selected navigation item changes to #c2c0c0.

Please can you tell me how to do this!

My code so far:

CSS:

.navContainer ul{
    left: 10px;
    top:  20px;
    position: absolute;
    color: #c2c0c0;
    font-family: 'Terminal Dosis';
    font-weight: 200;
    font-size: 20pt;
    list-style-type: none;
    line-height: 50px;
}
.navContainer {
    left: 150px;
    top: 150px;
    position: absolute;
}

HTML (within body tag)

<div class="navContainer">
                <ul>
                    <li style="color: #d49a9a">Work</li>
                    <li><a href="#">Blog</a></li>
                    <li>About</li>
                    <li>Contact</li>
                </ul>
            </div>
            <script type="text/javascript">
            $(".navContainer li").click( function() { 
                      $(".navContainer li, .navContainer li a").css("color", "#c2c0c0");
                      $(this).css("color", "#d49a9a");
                    });
            </script>
            <script type="text/javascript">

            </script>
        </body>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T11:25:43+00:00Added an answer on May 25, 2026 at 11:25 am

    I think you are looking for this take a look

    Working demo

    You just have to add the below class and on li click just set the color of the li element you click thats it

    .navContainer li:hover{ 
       color:#d49a9a
    }
    

    JS

    $(".navContainer li").click( function() { 
        $(this).css("color", "#d49a9a");
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a NAVIGATION MENU, and within this MENU I have selected tags hence
I am writing a css code for a webpage, i have a navigation menu
I have a navigation menu within a page on my site, which has JavaScript
I have navigation menu that once the user click then change and fade the
I have navigation menu using images, I want that if the user click a
I have a menu navigation area where I use .animate to slide the text
I have a strange issue with my css navigation menu. The code is here:
I have a navigation menu out side ckeditor and i want to navigate within
I have a navigation menu and when 'contact is clicked' a div opens at
Within an html file I have a menu set up as: <div id=informheader class=topmenu>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.