In Javascript, there is this wonderful property called innerText, which is rendering aware and will return all descendant's texts as you would expect in plain text. We don’t need to worry about the internal structure of an element. For example, if it has tags for bold text, spans, lists etc…