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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:46:36+00:00 2026-05-26T07:46:36+00:00

I have a list of posts and I’d like to remove all text/HTML content

  • 0

I have a list of posts and I’d like to remove all text/HTML content except the content set “strong”.

Original

<li id="post">
    <p>
        <strong>Reality</strong>
    </p>
    <p>
        Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
    </p>
</li>
<li id="post">
    <p>
        <strong>Buzz</strong><br>
        <br>
        Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
    </p>
</li>
<li id="post">
    <p>
        <strong>Innovation</strong><br>
        <br>
        Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
    </p>
</li> 

Desired Result

<li id="post">
        Reality
</li>
<li id="post">
        Buzz
</li>
<li id="post">
        Innovation
</li>

How can I do this using JQuery?

  • 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-26T07:46:37+00:00Added an answer on May 26, 2026 at 7:46 am

    My solution will be to make a selector that selects all strong $(“strong”) then remove all li’s and then .each item in $(“strong”), append it inside a new li.


    Update:

    You can try this: http://jsfiddle.net/6awfe/

    $("li#post").each( function()
        {
            $(this).html("[strong start tag]" + $("strong", this).html()+"[strong end tag]");
        } )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a series of divs like this: <div id=available-posts> <div class=post id=unique_id> <a
My page contains list of posts, each post has its own like button. The
I have a query to list all posts: SELECT *, DATE(FROM_UNIXTIME(`timestamp`)) `date` FROM `posts`
How can I list all posts that are in wp_posts and have the same
I have two categories, visible and hideMe... I want to list all posts in
I have read the other posts, e.g., vim: Executing a list of editor commands
I have a dynamic list of items that will be used to POST information
I have List objects which are shown like this: www.mysite.com/lists/123 Where 123 is the
I have a list of blog posts from users with avatars. Cause of some
I have 3 tables: posts , tags , *posts_tags* . I want to list

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.