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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T19:53:21+00:00 2026-05-17T19:53:21+00:00

Hi there , it my first time here – please go easy on me!

  • 0

Hi there, it my first time here – please go easy on me!

I am struggling to find an answer to my question which is:

How to add and remove a CSS .current class to a link when another link is clicked. For example, using this code:

<a class="boldthislink">Bold me?</a>
<a class="boldhim">bold him</a>
<a class="unboldhim">unbold him</a>

I want to make the first link bold by clicking the 2nd link and then unbold by clicking the third link. Is this possible?

For another example,

My dev site is here: Karls dev site

On my dev site I want to make the <a> link ‘background’ underline/bold when you click ‘Next‘ underneath the first paragraph of text, which will also send you to the next spread as it currently does. Then on the next page, when you click ‘Previous or next‘ the link ‘background’ isn’t underlined anymore, only the nav link of the spread that you are on, and so on.

Any help would be very appreciated!! Im a beginner with Jquery, and most of my code is open source taken from various places so may look scrappy to you! 🙂

Many thanks, Karl.

  • 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-17T19:53:22+00:00Added an answer on May 17, 2026 at 7:53 pm

    Bare minimum code (not optimized, polished, loved, given an education, or otherwise treated kindly):

    $('a.boldhim').click(function ()
    {
        $('a.boldthislink').addClass('current');
    });
    
    $('a.unboldhim').click(function ()
    {
        $('a.boldthislink').removeClass('current');
    });
    

    Make sure you’re calling it inside of a document ready handler, e.g. one of these:

    $(document).ready(function () { /* your code here */ });
    

    or this (which shorthand for the above):

    $(function () { /* your code here */ });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

first time poster here. I usually like to find the answer myself (be it
First time I post a question, so here it goes. I want to push
Here is the question: There are 5 sorted list A,B,C,D,E, which has the same
This is my first time posting a question here, it has been a valuable
(first time actually asking a question here, so forgive my etiquette blunders) Base Situation
I'm first time poster here trying to pick up some Python skills; please be
Long time lurker, first time poster here. My question is: Using C# 2.0, is
this is my first time to post a question here, I will try to
First time I ever ask a question here so correct me if I´m doing
This is my first time on here, so I'm bit nervous and please forgive

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.