JSFiddle - React, Tailwind, and code Playground
HTML
<div id="content"></div>
CSS
.red {color: red;}
JavaScript
$(document).ready(function() {
function addText() {
var newParagraph = document.createElement('p');
newParagraph.className = 'red';
newParagraph.appendChild(document.createTextNode("i am a new text node."));
document.getElementById('content').appendChild(newParagraph);
}
addText();
});