Image Slider Lab

Easy
18
48.7% 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:

  1. Create button elements with specific ids for previous and next buttons.
  2. Create an img element with a specific id to show the images.
  3. Initialize the img element's 'src' with the first image URL from the images array.
  4. Implement click events for both buttons to cycle back and forth through the images.