const contentString = "Hello, world";
document.body.innerHTML = contentString.sup();String.prototype.sup() / notebook
String.prototype.sup()
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
<sup>Hello, world</sup>const contentString = "Hello, world";
const elem = document.createElement("sup");
elem.innerText = contentString;
document.body.appendChild(elem);