JSFiddle - React, Tailwind, and code Playground

by ChaseWest

HTML

<div class="class">
    Here's some text that really should be in a p tag, but oh well
</div>

JavaScript

var text = $("div.class").text();

console.log(text);

text = "";

var el = document.getElementsByClassName("class")[0];
text = el.innerText;
console.log(text);