Image Slider Lab
Easy
19
48.8% Acceptance
In this lab, you are tasked to create a simple image slider using HTML, CSS, and JavaScript. Your image slider should have two buttons, one to go to the previous image and one to go to the next image. The slider should cycle through the images when the beginning or end is reached.
You will use an array of image URLs to simulate the actual image slider. Your main goal is to implement the proper cycling of the images when the respective buttons are clicked.
In order to achieve this, you need to:
- Create button elements with specific ids for previous and next buttons.
- Create an img element with a specific id to show the images.
- Initialize the img element's 'src' with the first image URL from the images array.
- Implement click events for both buttons to cycle back and forth through the images.