How to write left image scrolling javascript for html?

Hi,

Can someone help - want to know how to write left image scrolling javascript for html ? Looking correction on following function;

let n = 0;
let src = ["https://*.*file name"];

let e = document.getElementById('gallery0');
let next = function() {
           n + 1;
           if(n > src.length) n = 0;
           e.setAttribute('src' , src[n]);

};

e.onclick = next;
document.getElementById('nextlink').onclick = next;

Thanks,

Abhi

These forums are for asking questions regarding the use of Khronos APIs and standards, such as OpenGL. You’ll need to find someplace else to get help with Javascript development.

For reference, here are the Forum Posting Guidelines for these forums.