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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T12:58:35+00:00 2026-05-27T12:58:35+00:00

I have a NAVIGATION MENU, and within this MENU I have selected tags hence

  • 0

I have a NAVIGATION MENU, and within this MENU I have “selected” tags hence “current” tags, referring to the page the user is currently on. So within each HTML page, whatever page the user may be on, within the NAVIGATION MENU, the item in which they selected is HIGHLIGHTED in a sense to inform them on what page they are on.

The problem? I want to be able to automatically do this in JavaScript and or jQuery, because I will be implementing this within a Content Management System, and or an Includes, and wouldn’t be able to achieve applying a class to the current page if the NAVIGATION MENU is an Includes oppose to static HTML/CSS.

Does that make sense?
Any ideas?

Thank you so much!
Aaron

  • 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-27T12:58:36+00:00Added an answer on May 27, 2026 at 12:58 pm

    As you haven’t supplied any code, I can only give you a general example, but this might work, if the URLs are equal to the menu links.

    $('.navigation>ul>li>a').each(function(){
      if($(this).prop('href') == (window.location.pathname.match(/.*\/(.*)$/)||['',''])[1]){
        $(this).addClass('current');
      }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a navigation menu within a page on my site, which has JavaScript
I have a row of evenly-spaced navigation items, which looks like this: The currently
I have navigation menu that once the user click then change and fade the
I have navigation menu using images, I want that if the user click a
I have a left side navigation menu on my page.. using url.action like below..
I have a navigation menu out side ckeditor and i want to navigate within
I have a navigation menu on this site: http://blog.helpcurenow.org/test/redesignMockup/ where I have set the
I have my navigation menu working perfectly. But when I apply the selected class
I have a navigation menu within a .navContainer css div. Upon click, one of
Within an html file I have a menu set up as: <div id=informheader class=topmenu>

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.