Adding JavaScript Code

Finally, we add JavaScript code to activate the buttons.

  • Create in the leChocolat folder the subfolder js.
  • In the subfolder js, create a new file scripts.js.
  • Link ALL the HTML files with the scripts.js

Update the scripts.js with the following JavaScript code:

Carousel JS: