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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T21:19:50+00:00 2026-06-05T21:19:50+00:00

I am creating a system of displaying link information in an interactive way using

  • 0

I am creating a system of displaying link information in an interactive way using html attributes, and jQuery to move some of the HTML around. I am stuck trying to append a title attribute to a div. I’ve never done this with an attribute and am hitting some walls.

It’s hard to explain, but you will see what I am after when you see the JS.
http://jsfiddle.net/KvAwa/

thx for any help in advance

The HTML

<div id="navtool">
    <ul id="menu">
        <li id="1">
            <a href="location1.html" title="this is the decription1">This is the link1</a>
        </li>
        <li id="2">
            <a href="location2.html" title="this is the decription2">This is the link2</a>
        </li>
        <li id="3">
            <a href="location3.html" title="this is the decription3">This is the link3</a>
        </li>
    </ul>
</div>
<a href="#" class="prev nav">prev</a>
<a href="#" class="next nav">next</a>
<div id="linkdesciption"></div>
<a href="#" id="execute">Execute link</a>​

The JS

// Cycles Menu   
$('#menu > li:first').addClass('active');
$('.next').click(function(){
    $('.active').next().addClass('active').prev().removeClass('active');        
    $('#menu > li:last').after($('#menu > li:first'));
});
$('.prev').click(function(){
    $('.active').prev().addClass('active').next().removeClass('active');
    $('#menu > li:first').before($('#menu > li:last'));
});

// Collects the link  
var executeLink = $('#menu > li.active > a').attr("href");
$('#execute').attr("href", executeLink); 
$('#execute').click(function(){
   alert(executeLink);
});

// Collects title and inject into description
$('.nav').click(function(){
    var description = $('.active > a').attr('title'); 
    $(description).appendTo('#linkdesciption');
}); 
  • 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-05T21:19:52+00:00Added an answer on June 5, 2026 at 9:19 pm

    I think the relevant part of that code is:

    $('.nav').click(function(){
        var description = $('.active > a').attr('title'); 
        $(description).appendTo('#linkdesciption');
    }); 
    

    You want to turn that around:

    $('.nav').click(function(){
        var description = $('.active > a').attr('title'); 
        $('#linkdesciption').append(description);
    }); 
    

    Updated fiddle

    Or if you want to replace the previous link title with the new one, use html or text rather than append:

    $('.nav').click(function(){
        var description = $('.active > a').attr('title'); 
        $('#linkdesciption').text(description);
    }); 
    

    Updated fiddle

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

Sidebar

Related Questions

I'm creating a system using ASP.NET MVC for filling out online job applications. It's
I'm creating reservation system and I'm trying to sum up time string from form
I'm creating a system with a JavaScript client that will communicate with the server
I am creating a system tray app which monitors mouse clicks in Windows. I
I am creating a system that will store objects in an SQLite Database. I
I am creating a system for my dissertation for a school to use. There's
I'm interested in creating a system where the user can define the steps in
So, I'm creating a system which manages all the drupal websites that sit within
for sure this is not the best title. I'm creating a system to generate
I'm creating a log system ('outside' the application) that logs all the click on

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.