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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T14:39:08+00:00 2026-06-15T14:39:08+00:00

Though the title seems straight forward and simple, what I am trying to do

  • 0

Though the title seems straight forward and simple, what I am trying to do is a little bit more than it seems.

What I have is a search box to search for users on my website, to send a message to. It returns a list of users and you then click on the user(s) that you want to send a message to. Upon clicking on said user(s), I append the user in a li (it’s a contentEditable div by the way), and then allow for the user to continue searching for additional users. This all works how I want it to, what I am trying to do now is to remove the plain text from the search box.

so if someone types say, “Rober” and then clicks the user, “Robert Smith”, it should remove all plain text that is not wrapped in a li element.

I believe it would be something along the lines of say:

$("div.search").clone().children().remove().end().text();

I use this to filter the li text and such out when searching.

In a non working example of usage, I would say it should be something like this:

var text = $("div.search").clone().children().remove().end().text();

$("div.search").find(text).notIn("li").remove();

Edit

Rather than searching for the exact text to remove, it would probably be better and easier to just rmeove all text that is not wrapped in an li element.

  • 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-06-15T14:39:10+00:00Added an answer on June 15, 2026 at 2:39 pm
    $('div.search').find(':not(li):contains(' + text + ')').remove();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

actual problem seems a bit complicated than the Title says .. but hope someone
It seems as though my simple php echo statement will not allow me to
A have a little problem/question. Im trying to retrieve the most videos from the
I realize the title's a bit convoluted, so let me explain what I'm trying
This title may sound a little bit crazy, but this is what is making
I am trying to produce an effect where I have a title on a
Though the title says everything, I want to let you know the particular scenario
My title sums this up pretty well. My first though it to provide a
I have gone through this to change the color of my title bar. I'm
As in title I have a page that calls a lot of webservices through

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.