JSFiddle - React, Tailwind, and code Playground

by naokiota

HTML

<div class="myimg" style="width:350px;height:150px;background:#fcc;" onclick="disappear();">
	<img id="myPicture" src="http://placehold.it/350x150"> 
</div>
<script>
var imgNext = -1;
var start = new Date ( );

function disappear (){
 	var end = new Date ();
 	imgNext++;

	if (imgNext == 0){
    	document.getElementById("myPicture").style.visibility="visible";
    	setTimeout(function(){
    		imgNext = -1 ;	
    	},3000);
    	
	}	if (imgNext == 1){
    	document.getElementById("myPicture").style.visibility="hidden";
    	imgNext = -1 ;
	}

	start = new Date ();

}
</script>