JSFiddle - React, Tailwind, and code Playground

by lshettyl

HTML

<div id="result"></div>

JavaScript

var imageURLs = [
    "http://icons.iconarchive.com/icons/ergosign/free-spring/256/butterfly-icon.png",
    "http://fc05.deviantart.net/fs71/f/2012/062/5/c/butterfly_icon_by_pixtea-d4rjwa6.png",
    "http://www.officialpsds.com/images/thumbs/Butterfly-psd91066.png"
];

var randomIndex = Math.floor(Math.random() * imageURLs.length);
var $img = $("<img/>", {
    src: imageURLs[randomIndex],
    alt: 'Some Text'
});

$("#result").empty().append($img);