innerText returns only the text portions.
innerHTML returns the HTML code for all elements and text.
The following table lists the different values for innerText and innerHTML based on certain code.
CodeinnerTextinnerHTML
Hello world"Hello world""Hello world"
Hello world"Hello world""Hello world"
""""