You should be able to do this with hyperscript.
<img src="my_cat.jpg" alt="My cat" _="on click set @src to 'my_other_cat.jpg'">3 karma · joined July 2, 2022
<img src="my_cat.jpg" alt="My cat" _="on click set @src to 'my_other_cat.jpg'">