Yo ninjas! In this JavaScript tutorial, I’ll be showing you how to change your web page content on the fly via the DOM. To do this, we must follow two steps:
1. Reach into the page and grab a node / element
2. Change the property of that note (either innerHTML or textContent).
In this video, I do sometimes refer to these properties as methods – that is my mistake, although the concept is still very clear to see.
If you have any questions, fire away :).
SUBSCRIBE TO CHANNEL – https://www.youtube.com/channel/UCW5YeuERMmlnqo4oq8vwUpg?sub_confirmation=1
========== JavaScript for Beginners Playlist ==========
========== CSS for Beginners Playlist ==========
========== HTML for Beginners Playlist ==========
========== 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
Original source
9 responses to “JavaScript Tutorial For Beginners #34 – Changing Page Content”
How about
myTitle.innerHTML = "Yo Ninja would this work?" ;
can i get practice files?
Very straightforward explanations after I'd spent two hours banging my head against the wall in another paid-tutorial! Thank you.
The thumbnail says #33
love ur stuff buddy
I find your tutorials very easy to follow. Thanks for the great content, I now conquered my fear of javascripts
Dude good work thanks a lot from India well i wanna know this that apart from syntax what is the difference between .innerHTML and .textContent
are the class names in your html element used for SEO?
Hey Net Ninja, besides the syntax is there really any major difference between what these two properties can do?