manikant yadav

Generation

When I click on an image next image comes

<!DOCTYPE html> <html> <head> <title>JavaScript</title> <script type="text/javascript"> var i = 0; function nextImage() { var image = document.getElementById('myImage'); image.setAttribute('src', 'image' + ++i + '.jpg'); } </script> </head> <body> <img id="myImage" src="image1.jpg" onclick="nextImage()"> </body> </html>

Want to kickstart your project?Use the new AI Studio to create your code