JSFiddle - React, Tailwind, and code Playground
HTML
<div class="myDiv">some text</div>
CSS
.myDiv{width:196px;height:196px}
JavaScript
$(document).ready(function(){
var colors = ["http://boom-x.su/BG_01.jpg","http://boom-x.su/BG_02.jpg"];
var rand = Math.floor(Math.random()*colors.length);
$(".myDiv").css({"background-image":"url(colors["+rand+"])"});
});