JSFiddle - React, Tailwind, and code Playground

by Ahmad Sharif

HTML

<a href="#" id="slotTrigger"> 

    <span>
        <img id='id1' src='http://skylarksoft.us/6/1.gif' />
    </span>
    
    
</a>

JavaScript

$(document).ready(function() { 
						$('#id2').hide(500)       
				        $("img#id1", this).click(function() {
				        	$(this).attr('src', 'http://skylarksoft.us/6/2.gif');

				        	setTimeout(
								  function() 
								  {
								    $("img#id1").attr('src', 'http://skylarksoft.us/6/1.gif');
								  }, 2000);

				        });
				    });