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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T18:01:44+00:00 2026-05-12T18:01:44+00:00

just starting to get my hands dirty with the jQuery goodness and the first

  • 0

just starting to get my hands dirty with the jQuery goodness and the first task i’m trying to tackle is to underline a link after it has been clicked. Naturally, after a different link in the same div was clicked the previous one is no longer underlined…

Regards

  • 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-12T18:01:45+00:00Added an answer on May 12, 2026 at 6:01 pm

    So basically, you are wanting a kind of navigation menu that changes the style of the link once clicked. First, make a style that just underlines:

    <style type="text/css">
    a.currentlyActive
    {
      text-decoration: underline;
    }
    </style>
    

    The code you will be modifying is…

    <a class="navigation" href="#">My First Link</a>
    <a class="navigation" href="#">My Second Link</a>
    <a class="navigation" href="#">My Third Link</a>
    

    Just a few links with some type of class that denotes that it is the links u want to underline and not underline.

    Next, add a little jQuery magic to apply the style upon clicking. And at the same time, you will want to remove the style from all others.

    <script type="text/javascript">
    $(function() {
      $('.navigation').click(function() {
        // this removes the underline class from all other ".navigation" links.
        $('.navigation').removeClass('currentlyActive');
    
        // this makes the one that was clicked underlined
        $(this).addClass('currentlyActive');
      });
    });
    </script>
    

    And, that’s it. I tried to as verbose as possible to explain what each step does. Obviously, you can makes the class names shorter and remove the comments to make it small and lean.

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

Sidebar

Related Questions

I'm just starting to get my hands dirty with some basic jQuery. I want
I'm just starting to get into jquery/javascript programming so this may be a beginner
I am just starting to play with nservice bus and am trying to get
I'm just starting out learning OpenCL. I'm trying to get a feel for what
I'm just starting to get to grips with web development and trying to build
I'm just starting to get to grips with ideas and techniques behind complex networks
I'm just starting to get into test development and I'm struggling to understand what
as someone's who's just starting to get into Android/Java programming, I've read the docs
I just starting reading about SEO and realized that I should change my GET
I'm just starting with Adobe Flex on linux, and can't get the hello world

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.