<p>
Through-hiking is great!
<strong>No insipid election coverage!</strong> However,
<a href="https://en.wikipedia.org/wiki/Absentee_ballot">casting a ballot</a>
is tricky.
</p>Text: wholeText property / notebook
Text: wholeText property
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
const paragraph = document.querySelector("p"); // Reads the paragraph
paragraph.removeChild(paragraph.childNodes[1]); // Delete the strong elementconsole.log(`'${paragraph.childNodes[0].wholeText}'`); // 'Through-hiking is great! However, '