JSFiddle - React, Tailwind, and code Playground

HTML

<p>This is a test <span id='span1' style='display:inline-block;'></span> to see if I can embed an inline block.</p>

<p>This is a test <span id='span2' style='display:inline-block;'/> to see if I can embed an inline block.</p>

JavaScript

var span1 = document.getElementById('span1');
var span2 = document.getElementById('span2');

var div = document.createElement("div");
div.style.width = "100px";
div.style.height = "50px";
div.style.backgroundColor = "red";
span1.appendChild( div );

var div = document.createElement("div");
div.style.width = "100px";
div.style.height = "50px";
div.style.backgroundColor = "blue";
span2.appendChild( div );