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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:48:18+00:00 2026-05-26T05:48:18+00:00

I have the following code. http://jsfiddle.net/CtMmT/4/ Now i need to remove the text from

  • 0

I have the following code.

http://jsfiddle.net/CtMmT/4/

Now i need to remove the text from the tag where you can find the “Google must dissappear” text

The output for that row must be

<a title="" href="http://www.google.com"></a>.

I tried to select the a tag , but i can’t get only that 1 tag.
I get always, all the a tags .
I tried with the following each loops.
But not with any result.

I can’t set any class on that tag to control so that is not an option.

$('ul.menu li.dhtml-menu').each(function() {


}); 

$('ul.menu li.dhtml-menu a').each(function() {


}); 
  • 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-26T05:48:18+00:00Added an answer on May 26, 2026 at 5:48 am

    If you’re just looking to remove the inner text of the anchor tag, you’ll need to loop through all the anchor tags in your div, and check their text() value.

    jQuery:

    $('#content a').each(function() {
        if ($(this).text() == 'Google Must disappear')
            $(this).text('');
    });
    

    Working example on jsFiddle.

    Edit for OP’s comment: Since you’re looking to manipulate an element based on the structure, rather than the inner text, I strongly recommend reworking your markup so that it is valid first. As your markup is right now, nesting a li directly inside an li is causing Firefox to close the first li tag:
    bad markup

    I would change the markup first, rather than writing some jQuery to deal with this tag soup.

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

Sidebar

Related Questions

I have following code (live: http://jsfiddle.net/xyZY8/1/ ): var str = '<div>hello</div><ul><li>Some text...</li>' + '<li>second
I have the following code at http://jsfiddle.net/qPtXL/ As you can see the problem is
I have following code (html,js,jquery) snippet ( http://jsfiddle.net/MUScJ/2/ ): <script type=text/javascript> function someFunc(){ html
I have the following code in HTML/CSS: http://jsfiddle.net/XmRNh/ As you can see, there is
Hey all. I have the following code: http://jsfiddle.net/g7Cgg/ As you can see, there are
I have the following code: http://jsfiddle.net/fCWJ5/1/ , and following doubts regarding the viewbox. body{margin:0;}
I have the following code: http://jsfiddle.net/SPWWx/ I'm completely new to javascript, this is my
let's i have the following code http://jsfiddle.net/QhJWt/ <span contentEditable=true>asdfasdf </span> span { height:20px; width:100px;
I have the following code: http://jsfiddle.net/3fT2M/ Why isn't the two floated div background color
I have the following code: http://jsfiddle.net/dbg5X/ Is it possible to have the second div

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.