DOM

HTMLCollections & NodeLists

Most of us believed, at least for some time, that in our DOM Scripting, we always dealt with arrays in our JavaScript:

1
2
3
var myLinks = document.getElementsByTagName('a'); // we have three links

myLinks.length; // "3"

Using innerHTML

innerHTML is a read/write property of a DOM element that gets/sets the HTML contained in the element.

The script tag and the DOM

Today I'm going to talk about the DOM. Things you might not know, tricks, nuances and some best practices (I think). So, let's get to it.