Answers for "javascript change multiple images onclick"

1

javascript change multiple images onclick

<h2>Change image onClick event here...</h2>
		<img src="imageName1.jpg" onmouseover="imagefun()" id="getImage">
  
    <script>
        function imagefun() {
            var Image_Id = document.getElementById('getImage');
            if (Image_Id.src.match("imageName1.jpg")) {
                Image_Id.src = "imageName2.jpg";
            }
            else {
                Image_Id.src = "imageName1.jpg";
            }
        }        
    </script>
Posted by: Guest on July-16-2020

Code answers related to "javascript change multiple images onclick"

Code answers related to "Javascript"

Browse Popular Code Answers by Language