Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- var images = ["images/OceanicTeaMockup.jpg", "images/RoseTeaMockup.jpg", "images/NorthernTeaMockUp.jpg",
- "images/GalaxyTeaMockup.jpg"]
- var imgState = 0;
- var imgTag = document.getElementById("imgClickAndChange");
- imgTag.addEventListener("click", function (event) {
- imgState = (++imgState % images.length);
- event.target.src = images[imgState];
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement