Get the text content of an element Returns the raw text content of the ele element and its children. All the HTML tags are excluded. const text = ele.textContent; Source https://htmldom.dev/get-the-text-content-of-an-element/