#What's the difference between InnerText, InnerHTML, and TextContent?
1 messages · Page 1 of 1 (latest)
Hi Eve. I’ll give it my best shot.
InnerText will return only the text in an element and its children, but will ignore any HTM formatting (ie. It won’t return the html tags and spaces contained within the element).
InnerHtml will return the entire content of an element and its children containing the html tags as well. You can also create an html element utilizing this method, ie. ‘…InnerHtml = <h>Hello, Eve</h>’
TextContent basically does the same as InneText but I believe it also respects your html formatting (though it doesn’t return it).
Hope this helps!
Wow! This really helps. Thank you so much Leo! Really appreciate it. 🙂