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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T08:13:46+00:00 2026-05-29T08:13:46+00:00

If you look at the selectors list on the jQuery website, there are selectors

  • 0

If you look at the selectors list on the jQuery website, there are selectors for starts-with and ends-with on attributes. There’s also a :contains selector for searching text:

alert( $("div").find("span:contains(text)").html() );

Does jQuery have an implementation for searching strings using starts-with or ends-with?

FYI: I need to search through an XML object.

  • 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-29T08:13:47+00:00Added an answer on May 29, 2026 at 8:13 am

    Not by default as far as I know, but you can add your own pseudo-selectors through $.expr[":"]: http://jsfiddle.net/h6KYk/.

    $.extend($.expr[":"], {
        "starts-with": function(elem, i, data, set) {
            var text = $.trim($(elem).text()),
                term = data[3];
    
            // first index is 0
            return text.indexOf(term) === 0;
        },
    
        "ends-with": function(elem, i, data, set) {
            var text = $.trim($(elem).text()),
                term = data[3];
    
            // last index is last possible
            return text.lastIndexOf(term) === text.length - term.length;
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

look at this fiddle: http://jsfiddle.net/ugxNK/ I want that the first list element is in
Look at this: $('form).submit(function (event) { $(':input.required').trigger('blur'); var num = $('.warning', this).length; alert(num);//Focus here!
look at this code, <head> <meta http-equiv=Content-Type content=text/html; charset=utf-8 /> <script> function change() {
I am new to jQuery and I am having trouble with the syntax, selectors
Is there a JS/jQuery widget that would allow me to display a simple legend
I looked at the post jQuery: Loop iterating through numbered selectors? and it didn't
When I look at the source code of the dojo 1.7 amd dependency list,
I have a view that contains a list of items, a TextBox and a
I am trying to implement a list that contains items of a certain type,
Look at the function below. I want to pass a vector of factors and

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.