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