I'm trying to create an onkeydown
event, that will automatically move an image gallery on a specific site to the next image, or back. Problem is, the link structure isn't structured efficiently.
So basically, I"m trying to find within the userscript whether the image that you would click to go back or to go forward exists on a page, with if statements, to determine whether the back/forward action (left arrow / right arrow on keyboard respectively) can actually be done.
How would I go about determining whether said image(s) exist on the page?