JSFiddle - React, Tailwind, and code Playground

HTML

<p id="p">< A</p>
<pre id="logger"></pre>

JavaScript

function LOG(text) {
  logger.appendChild(document.createTextNode('"' + text + '"\n'));
}

LOG(p.innerHTML);