replace img src with jquery on click
问题 This might seem as child play, but I can't figure out how I can replace the src attribute of an image. The src is "build.php" which generate the image. What I want is when I click on "mix" it will run build.php to generate a new image, remove the old image and display the new image with a nice fadeout/fadein. Also with an "Building new image" which hides when the new image is done loading. I tried with $("#mix").click(function(){ var img = new Image(); $(img).load(function () { $(this).hide()