JSFiddle - React, Tailwind, and code Playground

JavaScript

$(function(){

var element1 = $('<div />').text('element1').addClass('blue');
$('body').append(element1);

$('.blue').css('background-color', 'blue');
    
$("<style type='text/css'> .blue{ background-color:blue;} </style>").appendTo("head");

var element2 = $('<div />').text('element2').addClass('blue');
$('body').append(element2);

});