JSFiddle - React, Tailwind, and code Playground

CSS

.testDiv { width:150px; height:100px; }

JavaScript

var div = $("<div></div>").addClass("testDiv").css("display", "none");

$(document).ready(function () {
    $("body").append(div);
    alert($(div).width());
    $(div).remove();
});