Summary
You learned quite a bit in this chapter. You have learned some cross-browser BOM (Browser Object Model) objects:
Properties of the global
windowobject such asnavigator,location,history,frames,screenMethods such as
setInterval()andsetTimeout();alert(),confirm()andprompt();moveTo/By()andresizeTo/By()
Then you learned about the DOM (Document Object Model), an API to represent an HTML (or XML) document as a tree structure where each tag or text is a node on the tree. You also learned how to do the following actions:
Access nodes
Using parent/child relationship properties
parentNode,childNodes,firstChild,lastChild,nextSibling, andpreviousSiblingUsing
getElementsById(),getElementsByTagName(),getElementsByName(), andquerySelectorAll()
Modify nodes:
Using
innerHTMLorinnerText/textContentUsing
nodeValueorsetAttribute()or just using attributes as object properties
Remove nodes with
removeChild()orreplaceChild()And add new ones with
appendChild(),cloneNode(), and...