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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T03:34:23+00:00 2026-06-13T03:34:23+00:00

jsfiddle I am trying to style my current navigation tabs. I also have a

  • 0

jsfiddle

I am trying to style my “current” navigation tabs. I also have a hover script in jQuery which is causing difficulties doing this:

<ul class="nav">
    <li class="nav1" id="current"><a href="#">Images</a></li>
    <li><span>.</span></li>
    <li class="nav2"><a href="#">Articles</a></li>
    <li><span>.</span></li>
    <li class="nav3"><a href="#">Links</a></li>
    <li><span>.</span></li>
    <li class="nav4"><a href="#">Contact</a></li>
</ul>

//This bit does not work as expected. -->
$(".nav li a").click(function(){

    $("li#current").removeAttr('id');
    $(this).parent().attr("id","current");

});

Basically I need to move the id from the first li anchor to whichever other li anchor is clicked, and have this newly placed id recognised by the hover script.

E.g. When you click “Articles”, “Images” disappears in blue, and “Articles” appears in blue and stays visible once the mouse is moved.

Anyone know how to do this?

  • 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-13T03:34:24+00:00Added an answer on June 13, 2026 at 3:34 am

    Better way is to add extra class currenton selected item — class="nav1 current"

    $(".nav li a").click(function(){
        $(this).parent().parent().find('li').removeClass('current');
        $(this).parent().addClass('current');
    });
    

    Should be like that … have to check it.

    EDIT: Yes it works.

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

Sidebar

Related Questions

I this: http://jsfiddle.net/ZP76c/ I'm trying to control the scope at which jQuery selects elements
I have a Google Instant style jQuery search script that queries a PHP file
I'm trying to style a simple a tag to have a preceding icon which
I am trying to implement a metro style slide UI using jquery in which
I have a simple jsfiddle where i am trying to change value of each
I have been trying to get this jsfiddle to work. So far without luck.
I'm trying to build this layout: I have this at this time: http://jsfiddle.net/Gh6mB/12/ The
Im trying to create a facebook style newsfeed. Using jquery, I've managed to set
http://jsfiddle.net/jasondavis/Mt87G/1/ I am trying to do an un-ordered list, each list item will have
jsFiddle I'm trying to remove the border of a div using jQuery, but it's

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.