Check out example codes for "javascript innertext vs innerhtml". It will help you in understanding the concepts better.

Code Example 1

innerHTML shows everything inside of the element.
innerText shows only the text inside of the element.

Learn ReactJs, React Native from akashmittal.com