JSFiddle - React, Tailwind, and code Playground

by Troy Johnson

HTML

<div id="navspace"></div>

CSS

#navspace {
	height: 375px;
	width: 100%;
	background-image: url("images/dock.jpg");     /* Use quotes when defining a file path */
}

JavaScript

function Randomize() {
	var images = new Array("http://aalbc.com/tc/uploads/monthly_2015_09/troy-blank-background-200pxwide.png.d820252a2ec9eb94c9a24cc265100cd4.thumb.png.6e0ebb2f4fff3962619bcacc79c85dfb.png",
"http://aalbc.com/tc/uploads/monthly_2015_09/ChrisBurns-0594sam.jpg.a5ddab4242c6c3e6933b641794a17a97.thumb.jpg.8f8402fa5f4369a9e4135102ada22d5d.jpg",
"http://aalbc.com/tc/uploads/monthly_2015_11/IMG_20151117_031855.jpg.c655d203df86a79925334df977073393.thumb.jpg.3ed132a8432b677f078dade6ce569f15.jpg",
"http://aalbc.com/tc/uploads/set_resources_2/84c1e40ea0e759e3f1505eb1788ddf3c_default_photo.png");
	var imageNum = Math.floor(Math.random() * images.length);
	document.getElementById("navspace").style.backgroundImage = "url('" + images[imageNum] + "')";
}

window.onload = Randomize;