Summary
You learned quite a bit in this chapter. You learned the following cross-browser BOM objects:
Properties of the global
window
object, such asnavigator
,location
,history
,frames
,screen
Methods such as
setInterval()
andsetTimeout()
;alert()
,confirm()
andprompt()
;moveTo/By()
andresizeTo/By()
Then, you learned about the DOM, 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 perform the following actions:
Accessing nodes:
Using parent/child relationship properties, such as
parentNode
,childNodes
,firstChild
,lastChild
,nextSibling
, andpreviousSibling
Using
getElementsById()
,getElementsByTagName()
,getElementsByName()
, andquerySelectorAll()
Modifying nodes:
Using
innerHTML
orinnerText/textContent
Using
nodeValue
orsetAttribute()
, or just using attributes as object properties
Removing nodes with
removeChild()
orreplaceChild()
Adding new ones with
appendChild()
,cloneNode()
, andinsertBefore...