|
-
is this possible with jQuery? replace img based on src value?
I have a hell CMS to work with and am wondering if i can the following with jQuery (or just straight up JS)
images are being displayed with no ID's or classes. am wondering if i can replace images based on the src value
pseudo code would be uh.....something like
find img where src = /img/00789-reg-1.jpg';
and replace src value with ='img/much-better-img.jpg';
thanks -
-
It can be done with either. When is it supposed to happen? What is the event handler?
-
i guess it would be window.onload
really it's possible. what would the code be?
thanks much
is asap an event handler?
asap.event();
-
ummm,,.... does anyone know how to do this?, thanks
-
$(document).ready(function () {
$("img['src = /img/00789-reg-1.jpg']").attr('src","img['img/much-better-img.jpg']");
});
-
-
Hey,
i tried but it didn't work. first there was an error so moved an apostrophe as such..
$("img[src = '/img/728028233605-FBC-Original-1.jpg']").attr("src","img['img/product1-volusion.jpg']");
which seemed to correct the error but then nothing happened. as though it's not firing but i have within the document ready
handler.
$(document).ready(function(){
alert('test');
$("img[src = '/img/728028233605-FBC-Original-1.jpg']").attr("src","img['img/product1-volusion.jpg']");
})
any idea why this might not be working.???, was really looking forward to using. also, wanted to try the same with an anchor tag.
thanks for any help on this
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|
Bookmarks