Automatic Slideshow not stop when i use javascript event

I wrote a script to make an automatic slideshow, and i want it to stop when i onlick (or onmouseover) the image (or the content) but it not work for me. Someone please show me if there're any error in my code. Thank you!

There's a small typo in your code. Replace getElementsbyClassName with getElementsByClassName.

You can catch errors like this in the future by using your browser's developer console, where it will tell you where's an error in your code and what type. Just search for Developer Tools, it will help you find and fix errors like this yourself.

Edit:

Oh yes, didn't see that one. There is indeed also an error in this line:

document.getElementsByClassName("fade").onclick=function(){stop()};

Here's the issue. getElementsByClassName does not return a DOM element, but rather an array of elements, since there are multiple elements with that class name. You'll have to loop through each one in order to access onclick on them, just like you did in your function above, like this: