This is what you wanna do:
var oldSrc="http://example.com/smith.gif";
var newSrc="http://example.com/johnson.gif";
$('img[src="' + oldSrc + '"]').attr('src', newSrc);
More Related Contents:
- How can I modify with css an image appended with javascript?
- how to resize responsive image up and down
- How do I make two images fade in/out repeatedly? [closed]
- Check if an image is loaded (no errors) with jQuery
- Changing the image source using jQuery
- Asynchronously load images with jQuery
- How to resize images proportionally / keeping the aspect ratio?
- How do you cache an image in Javascript
- How to load all the images from one of my folder into my web page, using Jquery/Javascript
- How can I determine if an image has loaded, using Javascript/jQuery?
- In Bootstrap open Enlarge image in modal
- Disable dragging an image from an HTML page
- Load image with jQuery and append it to the DOM
- How do I abort image load requests without using window.stop()
- JavaScript: Know when an image is fully loaded
- Failed to load resource: net::ERR_CONTENT_LENGTH_MISMATCH
- Get image width and height from the Base64 code in JavaScript
- How to get the image size (height & width) using JavaScript
- Sort by image resolution in gallery
- Add image in pdf using jspdf
- jQuery resize to aspect ratio
- How to create a new img tag with JQuery, with the src and id from a JavaScript object?
- jQuery, JavaScript, HTML: how to load images after everything else is loaded?
- jQuery fade to new image
- Center an Image vertically and horizontally using CSS
- canvas- Cropping images in different shapes
- How do I get natural dimensions of an image using JavaScript or jQuery?
- How should I crop an image at client side using jcrop and upload it?
- Remove selected file(s) before upload with Javascript
- Crop image white space automatically using jQuery