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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T02:23:04+00:00 2026-06-16T02:23:04+00:00

The question has gotten rewritten. An Example: Here is an example HTML page: http://jsfiddle.net/mwMzD/2/

  • 0

The question has gotten rewritten.

An Example:

Here is an example HTML page: http://jsfiddle.net/mwMzD/2/

The Question:

When the Third Page link is selected, and the page is rendered, then the selected anchor tag should still keep the color "white", and not revert back to "grey" (a:visited).

Notice: Do keep in mind that a:visited applies to every visited anchor tag, and not just the last selected anchor tag.

Which methods are needed for this with jQuery?

  • 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-16T02:23:06+00:00Added an answer on June 16, 2026 at 2:23 am

    You need to apply a CSS class to the Third Page link when that page is rendered.

    <%= link_to "Third Page", route_to_third_page_path, class: "active" if current_page?(route_to_third_page_path) %>
    

    You’d then add this .active class to your a:active selctor

    a:link { color: grey; }
    a:visited { color: grey; }
    a:hover { color: white; }
    a:active, a.active { color: white; }
    

    Now, when the Third Page renders, the .active class will be applied to the link, causing it to take on the same style as a:active.


    Edit Now that you’ve completely rewritten your question

    Please see: http://jsfiddle.net/h67Ec/

    Here is the jQuery

    $(function(){
        $('a').click(function(){
          $('a').removeClass('active');
          $(this).addClass('active')
        });        
    });​
    

    and the styling from my original answer (see above) still applies.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This question has developed off an answer here . My question therefore is what
I know this question has been asked many times and we have gotten this
The closest answer I could find to my question here was this (which has
My question is based on the following example from Google . I have gotten
I've noticed my old question has gotten closed due to lack of details and
A previous question has gotten me thinking. Is it possible to simulate a MouseEvent.CLICK
This is probably a silly question, but curiosity has gotten the better of me.
I realise this question has been asked before however the previous answers have gotten
This question has two parts. Part 1. Yesterday I had some code which would
My question has two parts: Is it possible that, if a segfault occurs after

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.