Read element content with textContent (just text) or innerHTML (HTML markup).
const el = document.querySelector("p");
console.log(el.textContent); // "Hello"
console.log(el.innerHTML); // "<b>Hello</b>"
textContent is safer and faster. Use innerHTML only when you need HTML parsing.