Update the DOM With GetElementByld in JavaScript and AJAX


show more Updating the DOM with getElementById provides you with in-depth training on Developer. Taught by Ray Villalobos as part of the JavaScript and AJAX show less
please wait ...

Updating the DOM with getElementById

AJAX uses JavaScript to make changes to the current document through something called the DOM. This is the Document Object Model, and its job is to keep track of the structure of our HTML document. When you work with AJAX it's usually because you want to change something in your page after it has loaded. The easiest way to make a change in the DOM is through a JavaScript method called getElementByID. So the text editor that I use has a really nice DOM preview feature, so I'll turn that on right here, and you can see the DOM for our current HTML document. You can see that there is an HTML tag and inside the HTML tag we have a head section that has a couple of other elements, as well as a body section with just a script tag.

If we add another element here--let me add a headline--you will see that that element gets added into the document structure. If I add a paragraph, that also gets added, and if I create an element like an emphasis tag inside my paragraph, that gets added as a chi...

Updating the DOM with getElementById
Video duration: 2m 38s 1h 12m Intermediate

Viewers:

Updating the DOM with getElementById provides you with in-depth training on Developer. Taught by Ray Villalobos as part of the JavaScript and AJAX

Subjects:
Developer Web
Software:
Ajax JavaScript
Author:
please wait ...