Difference between innerText and innerHTML in javascript

advertisements

What is difference between innerHTML, innerText and childNodes[].value attributes in javascript?


Unlike innerText, though, innerHTML lets you work with HTML rich text and doesn't automatically encode and decode text. In other words, innerText retrieves and sets the content of the tag as plain text, whereas innerHTML retrieves and sets the same content but in HTML format.