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!
Sur cette page du site, vous pouvez voir la vidéo en ligne textContent vs innerHTML in the JavaScript DOM durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur dcode 22 juin 2018, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 56,046 fois et il a aimé 972 téléspectateurs. Bon visionnage!