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

  • Home
  • SEARCH
  • 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 195447
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T16:40:59+00:00 2026-05-11T16:40:59+00:00

I have tried finding a simialr example and using that to answer my problem,

  • 0

I have tried finding a simialr example and using that to answer my problem, but I can’t seem to get it to work, so apologies if this sounds similar to other problems.

Basically, I am using Terminal Four’s Site Manager CMS system to build my websites. This tool allows you to generate navigation elements to use through out your site.

I need to add a custom bit of JS to append to these links an anchor.

The links generated are similar to this:

<ul id="tab-menu">
<li><a href="/section/page">test link, can i rewrite and add an anchor!!!</a></li>
</ul>

I can edit the css properties of the link, but I can’t figure out how to add an anchor.

The JQuery I am using is as follows:

<script type="text/javascript" src="http://jquery.com/src/jquery-latest.pack.js"></script>
<script type="text/javascript">
    $(document).ready(function(){
    // everything goes here

    $("#tab-menu").children("li").each(function() { 
        $(this).children("a").css({color:"red"});

        });

    });
</script>

Thanks in advance for any help.

Paddy

  • 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-11T16:40:59+00:00Added an answer on May 11, 2026 at 4:40 pm

    A nice jQuery-based method is to use the .get(index) method to access the raw DOM element within your each() function. This then gives you access to the JavaScript link object, which has a property called ‘hash’ that represents the anchor part of a url. So amending your code slightly:

    <script type="text/javascript">
        $(document).ready(function(){
        // everything goes here
    
            $("#tab-menu").children("li").children("a").each(function() {   
                $(this).css({color:"red"}).get(0).hash = "boom";
            });
    
        });
    

    Would change all the links in “#tab_menu li” to red, and attach “#boom” to the end.

    Hope this helps!

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

Sidebar

Ask A Question

Stats

  • Questions 111k
  • Answers 111k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I moved from WinXP SP2 to WinXP 3 and my… May 11, 2026 at 9:43 pm
  • Editorial Team
    Editorial Team added an answer What if you did something like this: h1 { /*… May 11, 2026 at 9:43 pm
  • Editorial Team
    Editorial Team added an answer jQuery UI doesn't have to be used as whole 110kb… May 11, 2026 at 9:43 pm

Related Questions

I've been using javascript for a while, but have never learned the language past
A class I am taking currently requires us to do all of our coding
I'm making a small file-browser for my own use, in Ruby, and using Qt
I have a form in VB6 with two combo boxes (cboCustomer and cboItemNumber). When
Part of a new product I have been assigned to work on involves server-side

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.