Swapping the position of two images with JavaScript
问题 So i am trying to make it so if you click on the button it will switch the images placement. However it doesnt actually switch the placement but instead just changes the src of each image ID. It works when you click the button once, but after that the images no longer switch. This is my code function swapImages(){ var image1 = document.getElementById("image1") var image2 = document.getElementById("image2") if (image1.src = '/jmurphy9/111/images/earthrise.jpg') { image1.src = '/jmurphy9/111