Skip to main content
edited tags
Link
Josip Ivic
  • 3.9k
  • 2
  • 24
  • 51
Tweeted twitter.com/StackWebmasters/status/709608326766727172
more direct question as title
Link
Stephen Ostermiller
  • 99.4k
  • 18
  • 141
  • 364

Does Googlebot trigger javascriptonclick events and index the resulting content?

Source Link

Does Googlebot trigger javascript events?

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.