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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:13:35+00:00 2026-05-23T11:13:35+00:00

I have such html: <li> <a href=#>2012: Ice Age</a> <br> <a href=#> blah blah

  • 0

I have such html:

<li>
  <a href="#">2012: Ice Age</a>
  <br>
  <a href="#"> blah blah </a>
  <br>
     This text should disappear!!!
</li>

How to I remove that text with Jquery? I don’t have a control over this code, so I cannot add any IDs for easier selection..

  • 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-23T11:13:36+00:00Added an answer on May 23, 2026 at 11:13 am
    $('li').contents().last().remove();
    

    If it is at the end, you can use the contents()[docs] method (which gets all children, including text nodes, and the last()[docs] method to target the last one.

    Example: http://jsfiddle.net/KtTfQ/


    EDIT:

    You could also just empty the content of that text node:

    $('li br:last-child')[0].nextSibling.nodeValue = '';
    

    Example: http://jsfiddle.net/KtTfQ/2/

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

Sidebar

Related Questions

I have such xpath expression : link[@rel='alternate' and @type='text/html' or not(@rel)]/@href | link/text() ?
I have html which contains such text ....... <a class=product_name href=index.php?productID=29785>Funny</a> ........ <a class=product_name
I have such html and css. <div class=selected> <div class=text>First</div> <div class=arrow>&nbsp;</div> </div> .selected
I have HTML that includes symbols such as the Trademark TM as superscript (™).
Is there a better way to concatenate strings that have 's (such as HTML
I have such content of html file: <a class=bf title=Link to book href=/book/229920/>book name</a>
I have such a piece of html: <li class=addToFriends><a href=....>Something something<span>INSIDE SPAN</span>something</a></li> To handle
On my page http://example.com/games/games/ipad.html I have links such as: <a href=/../2010/junee2010/44/Grand Theft Auto Chinatown
I have a list as such : <ul id=yearMenu> <li>Select a year</li> <li><a href=AJAX/2010PR.html>2010</a>
assume I have a such html order <div id=header>>Header(logo, navigation menus etc)will be here,

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.