// get the text inside an element const text = element.innerText; // get the html content inside an element const html = element.innerHTML;