i have a javascript code that enables me to generate a clickable image that will display preloaded random images when clicked.

my question is: can the clicking of the image happen only once? is there a way to stop it from being perpetually clicked?