Link to home
Start Free TrialLog in
Avatar of Brad Bansner
Brad Bansner

asked on

jQuery: how to select and fadeOut an image based on container ID and 'src' attribute

Given the attached HTML, lets say I have a variable such as:

var replaceImage='art/gr_number_1.jpg';

How can I select the image based on its container ID (the DIV) and its 'src' attribute? I tried these two things with no luck:

$('img[src$=removeImage]').fadeOut(200);
$('src', removeImage).fadeOut(200);

Thanks!
<div id="question1">
<img class="ranknum" src="art/gr_number_1.jpg" width="200" height="240" border="0" />
</div>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of adilet_nasirdinov
adilet_nasirdinov
Flag of Italy image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Brad Bansner
Brad Bansner

ASKER

I tried that, didn't work. Then removed the > sign, now it works. Should that really be needed?