6

I've looked high and low through the docs and internet, and damn if I can't figure this out.

I would like to use jquery to select all images with a specific source and apply a tool tip to them. I have the tooltip working fine when I'm finding the target with classes, but I figured it would be a bit more efficient and avoid adding unneeded classes when I should be able to select all the images with a known img source. The code that I think should work is:

$("img[src*='phone']")

The image tag in the source is:

<img src='images/icons/Phone-32x32.png'>

Using Firebug's Dom inspector, the img element has the following source:

"http://www.deleted.com/v2/images/icons/Phone-32x32.png"

I've dicked around with various waves of selecting it, and it's beyound me. Any help would be greatly appreciated.

Ryan
  • 804
  • 1
  • 11
  • 24

2 Answers2

6

Ugh... The issue was capitalization! Changed it to:

$("img[src*='Phone']")

Now it works fine. Please ignore my stupidity.

chakeda
  • 1,551
  • 1
  • 18
  • 40
Ryan
  • 804
  • 1
  • 11
  • 24
0

If you'd like a case-insensitive selector this question might be helpful:

Is there a case insensitive jQuery :contains selector?

Community
  • 1
  • 1
MDCore
  • 17,583
  • 8
  • 43
  • 48