JSFiddle - React, Tailwind, and code Playground

by Yair Even Or

HTML

<button>change image</button>
<img src='data:image/gif;base64,R0lGODlhAQABAIAAAP///////yH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==' />

CSS

html, body{ height:100%; }
img{ height:100%; display:block; }

JavaScript

var img = $('img'),
    i = 1;


 $('button').click(changeSrc);

function changeSrc(){
    if( i > 3 ) i = 1;
    img.removeAttr('src');
    img.attr('src', 'http://dropthebit.com/demos/progressive'+ i +'.jpg');
    i++;
}