SHARE

Hey gang, in this JavaScript DOM tutorial I’ll be showing you how we can edit text content and HTML content using two different properties – textContent and innerHTML.

—– COURSE LINKS:
+ Atom editor – https://atom.io/a
+ GitHub Repo – https://github.com/iamshaunjp/JavaScript-DOM-Tutorial

———————————————————————————————
Other tutorials:

—– JAVASCRIPT FOR BEGINNERS:
https://www.youtube.com/playlist?list=PL4cUxeGkcC9i9Ae2D9Ee1RvylH38dKuET

—– CSS FOR BEGINNERS:
https://www.youtube.com/playlist?list=PL4cUxeGkcC9gQeDH6xYhmO-db2mhoTSrT

—– NODE.JS TUTORIALS
https://www.youtube.com/playlist?list=PL4cUxeGkcC9gcy9lrvMJ75z9maRw4byYp

—– SUBSCRIBE TO CHANNEL – https://www.youtube.com/channel/UCW5YeuERMmlnqo4oq8vwUpg?sub_confirmation=1

============== The Net Ninja =====================

For more front-end development tutorials & to black-belt your coding skills, head over to – https://www.youtube.com/channel/UCW5YeuERMmlnqo4oq8vwUpg or http://thenetninja.co.uk

================== Social Links ==================

Twitter – @TheNetNinja – https://twitter.com/thenetninjauk

5 COMMENTS

  1. Man you' re making such great tutorials …
    could you please explain the difference between
    textContent vs innerText ? …
    Thanks.

  2. Synopsis:

    document.querySelectorAll(".name") will return nodelist

    document.getElementsByClassName(".name") will return HTML Collection

    we can use Array.from() method to convert HTML Collection to Array and then we can apply forEach.

    ——————————————————————————-

    we can use textcontent to grab the existing content of the tag or to assign new text.

    we can use innerHTML to grab the existing content of the tag or to assign new text , append to existing HTML.

    Thank You !!

LEAVE A REPLY

Please enter your comment!
Please enter your name here