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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T07:11:25+00:00 2026-06-01T07:11:25+00:00

How do I turn this: <a class=link> <p class=paragraph>This is some text</p> <p class=paragraph>This

  • 0

How do I turn this:

<a class="link">
   <p class="paragraph">This is some text</p>
   <p class="paragraph">This is some more text</p>
   <p class="paragraph">And some more</p>
</a>

into this:

<a class="link">
   This is some text This is some more text And some more
</a>

with jQuery. I tried using append and merge but I just can’t figure it out.

  • 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-01T07:11:27+00:00Added an answer on June 1, 2026 at 7:11 am

    Since the text method returns the text content of an element and it’s descendants, you can just use that:

    var link = $("a.link");
    link.text(link.text());​​​​​​​​​
    

    From the docs:

    Get the combined text contents of each element in the set of matched
    elements, including their descendants.

    Here’s a working example.

    Update (see comments)

    In the case that this needs to apply to multiple .link elements, you can use each:

    $("a.link").each(function() {
        $(this).text($(this).text()); 
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

It should turn this int Yada (int yada) { return yada; } into this
I would like to turn this query to regular inline sql without using stored
How do I turn this text: • Ban Ki-moon calls for immediate ceasefire• Residents
Trying to turn this: href=/wp-content/themes/tray/img/celebrity_photos/photo.jpg into: href=/img/celebrity_photos/photo.jpg So I'm simply trying to remove /wp-content/themes/tray/
i have unicode link needed to be turn into links. Is it possible to
$('h2').each(function() { $('UL.chapters_list').append($('<li/>', {text: $(this).text()})) }); This code grabs all of the <H2> tags
I'm trying to build a website using object-oriented functionality, and running into some issues.
I'm getting more into jQuery and so have set up a HTML/Javascript/CSS base site
This is probably simple but I am new at jQuery so... In IE 8
I'm trying to make a pseudo link class with the CSS3 text-shadow for both

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.