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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T02:37:36+00:00 2026-06-12T02:37:36+00:00

I have four links and I would like content to appear in a div(.contentcont

  • 0

I have four links and I would like content to appear in a div(.contentcont [name of div]) below the list of links for that particular link that was clicked.

$('.link1').click(function(e){
$(this).clone().html('<h1>Text appear</h1>')
.appendTo('.contentcont')
               e.preventDefault();  
       });

I am using .html() to provide the content to be entered into the div. If you take a look at the js fiddle provided( http://jsfiddle.net/jack2ky/K3FaY/2/) you will be able to see that the new content is appearing in the div but it’s taking on the characteristic of the link [no good]. Maybe it has to do with me using .clone(). The reason why I am using .clone() is because when ever I clicked on the link the link would disappear. maybe you can tell me if using .clone() was the right solution to use to prevent the link from disappearing. And why the new content is taking on the link characteristic?

  • 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-12T02:37:38+00:00Added an answer on June 12, 2026 at 2:37 am

    .html() sets the inner HTML of your element. Your cloned element is still a <a> tag (you cloned your link), so you’re essentially appending a copy of your link with different text into the other element.

    If I’m reading your code correctly, you really don’t need to use .clone() or .html() at all. Just create a new element:

    $('<h1 />', {
        text: 'Text appear'
    }).appendTo('.contentcont');
    

    Demo: http://jsfiddle.net/Blender/K3FaY/8/

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

Sidebar

Related Questions

What I'd like to do is have a list of links that will match
If this were just a static website, i would have four links <li><a href=javascript:void(0)>Action
I would like to place some links in that footer that doesn't work as
I have four images. I would like them to rotate in a loop. Under
I have a list that looks like this: <ul id=theLinks> <li><a href=one.php>One</a></li> <li><a href=two.php>Two</a></li>
I have got four routes defined like this: //Project list with page number routes.MapRoute(
I have four activities namely, Demo_tabActivity.java [main activity] Tabhost.java The below two activities are
I have four activities namely, Demo_tabActivity.java [main activity] Tabhost.java The below two activities are
i have four tables user-question contains two columns: questionID, userID, the questions that the
i have four imageviews in a linear layout in such a manner that only

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.