Although commonly used interchangeably, there is a major difference between the textContent and innerHTML properties when working with Elements in JavaScript, and it's important you know what that is.
The major difference is that when using the innerHTML property, the client browser will actually interpret the content as HTML markup, and apply that change to the DOM/Window. On the other hand, the textContent property will only change the the text, preserving any HTML markup.
In this video I take you through a basic example to demonstrate that difference.
Support me on Patreon:
/ dcode - with enough funding I plan to develop a website of some sort with a new developer experience!
For your reference, check this out:
https://developer.mozilla.org/en-US/d...
https://developer.mozilla.org/en-US/d...
Follow me on Twitter @dcode!
If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!
Nesta página do site você pode assistir ao vídeo on-line textContent vs innerHTML in the JavaScript DOM duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário dcode 22 Junho 2018, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 56,046 vezes e gostou 972 espectadores. Boa visualização!