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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T02:56:09+00:00 2026-05-22T02:56:09+00:00

Any way to easily remove all HTML from text but keep all links? I

  • 0

Any way to easily remove all HTML from text but keep all links? I know how to strip all HTML tags, but can’t figure out how to keep just links…

Here’s my text:

<table border="0" cellpadding="2" cellspacing="7" style="vertical-align:top;">
<tr>
  <td width="80" align="center" valign="top"></td>

  <td valign="top" class="j">
    <font style="font-size:85%;font-family:arial,sans-serif"><br /></font>

    <div style="padding-top:0.8em;">
      <font style="font-size:85%;font-family:arial,sans-serif"><img alt="" height="1"
      width="1" /></font>
    </div>

    <div class="lh">
      <font style="font-size:85%;font-family:arial,sans-serif"><a href=
      "http://news.google.com/news/url?sa=t&amp;fd=R&amp;usg=AFQjCNHlTH-LLUq2nHL30fKdJcA62JseSg&amp;url=http://edition.cnn.com/2011/WORLD/africa/05/13/egypt.suzanne.mubarak/">
      <b>Egypt's former first lady said to have suffered a heart attack</b></a><br />
      <font size="-1"><b><font color="#6F6F6F">CNN
      International</font></b></font><br />
      <font size="-1">"Hosni Mubarak was also questioned about his luxury mansion in
      Sharm el-Sheikh," al-Gohary <b>said</b>. Last month, the <b>former</b>
      president <b>suffered a heart attack</b> during questioning over possible
      corruption charges, <b>Egyptian</b> state television reported.
      <b>...</b></font><br />
      <br />
      <a class="p" href=
      "http://news.google.com/news/more?gl=us&amp;pz=1&amp;ned=us&amp;ncl=dmv9Cur49MVVXrM">
      <font class="p" size="-1"><nobr><b>and
      more&nbsp;&#187;</b></nobr></font></a></font>
    </div>
  </td>
</tr>

Thanks

  • 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-22T02:56:09+00:00Added an answer on May 22, 2026 at 2:56 am

    Is this what you want?

    function getLinks() {
      var table = document.getElementsByTagName('table')[0];
      var links = table.getElementsByTagName('a');
      for (var i=links.length-1;i>=0;--i) {
        table.parentNode.insertBefore(links[i],table.parentNode.firstChild)
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any way to easily make a HTTP request with C++? Specifically, I
Is there any way of easily deciphering (i.e. at a glance) whether or not
Any way to make a OS X Finder like but valid XHTML/CSS search textfield
Any way I can get this working? I have a block of code: <p><a
Is there any way to capture the MouseDown even from the .NET 2.0 TextBox
Is there any way to easily fix this issue or do I really need
In Java you can use BigDecimal.stripTrailingZeros() to remove any extra zeros at the end.
It is possible to remove the extra Firefox-specific spacing from <button> tags . The
What's the best way to remove the very first line of a text string
Is there any way to easily use a remote javascript file as a content

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.