JSFiddle - React, Tailwind, and code Playground
HTML
<div class="zufallsbild">
DIV
</div>
CSS
.zufallsbild {
width: 50px;
height: 50px;
background-repeat: none;
}
JavaScript
var images = ['zufallsbild-1.png', 'zufallsbild-2.png', 'zufallsbild-3.png', 'zufallsbild-4.png'];
$('.zufallsbild').css({'background-image': 'url(https://www.insignicom.de/files/insignicom/news-tech-blog/2018-03/' + images[Math.floor(Math.random() * images.length)] + ')'});