From the course: The DOM in JavaScript, jQuery, AngularJS, and React

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Modifying text in the DOM

Modifying text in the DOM

From the course: The DOM in JavaScript, jQuery, AngularJS, and React

Start my 1-month free trial

Modifying text in the DOM

- [Male Instructor] The easiest way to get content and modified content from an HDMI element is by using the inner HTML property of the element interface. Now, this probably is quite useful for inserting and replacing content of the element or if you want to just extract data from a particular tag. You can only extract data from a container tag, which means the container tag is things like, for example, your paragraph tags, you H1 tags, and so on that contain tags. So what that means is that the code between the elements opening and closing tag can be extracted. That includes all the text in there as well as any container tag or other element tags in there can also be extracted. And this is one of the ways how dynamic webpages can be created on the fly and also by using Javascript to do that, you can simply change anything in the container tags. So, lets' tale a look at this inner HTML and see what it can do for us. At the top here again is the output. I'm only showing the images…

Contents