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 9174797
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T16:48:41+00:00 2026-06-17T16:48:41+00:00

I have the default link color active when you enter the site but I

  • 0

I have the default link color active when you enter the site but I can’t seem to get it to remove off active when mouse clicks on another link and the new current page is now active. here is my code.

JS

$("a").on("click", function() { 
    $(".active").removeClass("active"); 
});

CSS

.active{ 
    color: #ffff00 
    !important; 
}

a { 
    text-decoration: none; 
    z-index: 5; 
    font-family: arial, "Trebuchet MS"; 
    cursor: pointer; 
    color: #2777A3; 
}

HTML

<a href="http://www.pro.com/" target="_self" class="active">Home</a>`

home page active by default but when clicked on another link, new link does not show active color

  • 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-06-17T16:48:42+00:00Added an answer on June 17, 2026 at 4:48 pm

    If you just have HTML, CSS, and JQuery, you just need to set the active class on the right link on each page. You don’t need to remove classes with JQuery.

    What seems to be happening is that when a user clicks on a link, the page reloads, which resets the CSS and puts the active class on the Home link again. Every time the user clicks, the page will refresh and reset the class.

    So, JQuery will effectively remove the class, but then clicking on the link will send the browser to the new page and reset the CSS.

    Example:

    Home

    <a href="http://www.pro.com/" target="_self" class="active">Home</a>
    <a href="http://www.pro.com/products" target="_self">Products</a>
    <a href="http://www.pro.com/solutions" target="_self">Solutions</a>
    

    Other Page 1

    <a href="http://www.pro.com/" target="_self">Home</a>
    <a href="http://www.pro.com/products" target="_self" class="active">Products</a>
    <a href="http://www.pro.com/solutions" target="_self">Solutions</a>
    

    Other Page 2

    <a href="http://www.pro.com/" target="_self">Home</a>
    <a href="http://www.pro.com/products" target="_self">Products</a>
    <a href="http://www.pro.com/solutions" target="_self" class="active">Solutions</a>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to be able to have default text like Enter content here... appear
I have some default values for testing my code, but for security reasons those
I have a little app that have by default youtube as homepage. You can
I have a link: <a class=fg-button ui-state-default fg-button-icon-left assistButton pbcType=download title=Click for download information><span
I have a default a:hover style as follows: a:hover { color: black; font-size: 8pt
I have the following dom structure: <div class=ui-tabs> <ul> <li class=ui-state-default ui-tabs-selected ui-state-active> <a
I'm trying to create a tabbed navigation. I can't get my hover color to
I have a header within the following html page and I can't get the
I have a jqGrid and it has a default color: blue. However I want
My server have default php version of 4, so when I run some script

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.