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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:29:40+00:00 2026-05-25T19:29:40+00:00

Hi is there anyway to search text in dom, as we do for SQL

  • 0

Hi is there anyway to search text in dom, as we do for SQL query LIKE?

i mean, i have.

<ul>
<li>ab</li>
<li>abrecot</li>
<li>abus</li>
<li>aby</li>
<li>abrea</li>
</ul>

i would like to search for “abre” and so return in text ASC order:

<li>abrea</li>
<li>abrecot</li>

is this possible?

definitely the query would looks like doing:

SELECT <li> FROM <ul> WHERE text LIKE 'abre%' ORDER BY text ASC; :))
  • 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-25T19:29:41+00:00Added an answer on May 25, 2026 at 7:29 pm

    As you are looking for elements whose text starts with a specified string, you can use the filter method:

    var x = $("ul li").filter(function() {
        return $(this).text().substr(0, 4) === "abre";
    });
    

    This will only return elements which have the string “abre” at the start. The other answers using the contains method will return elements with the string found anywhere within them, which does not match your pseudo-SQL query.

    Here’s a working example of the above.

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

Sidebar

Related Questions

If I have the following full text search query: SELECT * FROM dbo.Product INNER
I have a text area with HTML content,now i want to search there for
Is there any way to keep search engines from indexing text ads? These are
Is there anyway to ask Fuzzy Finder plugin for VIM search subdirectory as well?
Is there anyway to have a sort of virtual static member in C++? For
Is there any way to search the full text of all the revisions (or
I have a pure text file without any HTML formatting. I want to search
I have a MYSQL full text search, matching against items in my database, which
Is there anyway to change a text input's value (the default text that displays)
In javascript, is there anyway to query how large css/js files are, and how

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.