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
From the course: The DOM in JavaScript, jQuery, AngularJS, and React
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
Developer tools7m 12s
-
(Locked)
What is the DOM?5m 18s
-
(Locked)
The DOM tree5m 59s
-
(Locked)
nodeType and nodeName properties7m 17s
-
(Locked)
The Node interface10m 50s
-
(Locked)
The Document object12m 8s
-
(Locked)
The Document methods10m 27s
-
(Locked)
Element objects10m 24s
-
(Locked)
Modifying text in the DOM9m 16s
-
(Locked)
Event objects11m 54s
-
(Locked)
Window object6m 56s
-
(Locked)
CSS properties and the DOM13m 50s
-
(Locked)
Traversing the DOM tree10m 18s
-
-
-
-
-
-