HTML OnClick image source changes in web, but not mobile

57 views Asked by At

I'm working in Wordpress with the Elementor block builder and I'm trying to have a .gif image switch sources to another .gif image. The OnClick event I have works perfectly fine via web, but not mobile. I've searched endlessly and have made sure another element is not blocking the touch event, added OnTouch, etc but to no avail.

<img src="https://lowlifeclothing.co/wp-content/uploads/2020/09/Loop1.gif"
onClick="this.src='https://lowlifeclothing.co/wp-content/uploads/2020/09/Loop1D.gif'">
1

There are 1 answers

1
luek baja On BEST ANSWER

Change onClick to onclick:

<img src="https://lowlifeclothing.co/wp-content/uploads/2020/09/Loop1.gif"
onclick="this.src='https://lowlifeclothing.co/wp-content/uploads/2020/09/Loop1D.gif'">

HTML attributes are case sensitive.