I've found many topics about Googlebot following links and executing ajax queries but none that tell me whether onclick events would get triggered and results crawled.
Let's say that an image is loaded when another element on the page is clicked:
<img src="#" data-src="path/to/image.jpg">
<span onclick=" this.previousElementSibling.src = this.previousElementSibling.dataset.src; ">click</span>
I would like to know if this image would get crawled by Googlebot.