I have the following code.
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() {
});
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 theirtext()value.jQuery:
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

lidirectly inside anliis causing Firefox to close the firstlitag:I would change the markup first, rather than writing some jQuery to deal with this tag soup.