JSFiddle - React, Tailwind, and code Playground

by techiedelight

HTML

<html>
<body>
  <div id="container"></div>
</body>
</html>

JavaScript

var url = "https://cdn.pixabay.com/photo/2015/12/01/20/28/road-1072823_1280.jpg";

var div = document.getElementById("container");
div.style.backgroundImage = `url(${url})`;
div.style.width = "640px";
div.style.height = "374px";