Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

117
Views
Find all images whose source attribute value ends with some string

How can one find all images whose source ends with for example "xyz.jpg"?

Using jQuery?

When I do: jQuery("img[src$='xyz.jpg']") what am I getting back?
Is this an array-like thing or not? I am confused.

Seems like I am getting a single object. How can I get all such objects?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

jQuery('.some-selector') (or $('.some-selector')) returns a jQuery object (https://api.jquery.com/Types/#jQuery).

A jQuery objects behaves very much like an array of DOM elements. It has a length property and you can access these elements by index ($('.some-selector')[0]), but it is not a true array, and you won't find the common Array methods on this object.

So yes it return a single jQuery object, but that object might consist of zero, one or multiple DOM elements that matched your selector.

When you access the DOM elements in the jQuery collection you get "raw" DOM elements, i.e. you cannot use jQuery methods on them. Typically you would use jQuery methods on the entire collection, or rewrap individual elements in jQuery.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!