JSFiddle - React, Tailwind, and code Playground

by Otobong Okoko

HTML

<img id='random'/>

JavaScript

var image = new Array ();
image[0] = "http://placehold.it/200";
image[1] = "http://placehold.it/300";
image[2] = "http://placehold.it/400";
image[3] = "http://placehold.it/500";
var size = image.length
var x = Math.floor(size*Math.random())

$('#random').attr('src',image[x]);