We have covered quite a bit in this chapter. You have learned some cross-browser BOM (Browser Object Model) 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 (Document Object Model) as a way to represent an HTML (or XML) document as a tree structure where each tag or text is a node on the tree. You learned how to:
Access nodes:
Using parent/child relationship properties parentNode,
childNodes
,firstChild
,lastChild
,nextSibling
,previousSibling
Using
getElementsById()
,getElementsByTagName()
,getElementsByName()
Modify nodes:
Using
innerHTML
orinnerText/textContent
Using
nodeValue
orsetAttribute()
or just using attributes as object properties
Remove nodes with
removeChild()
orreplaceChild()
And add new ones with
appendChild()
,cloneNode()
,insertBefore()
We also looked at some DOM0 (pre-standardization...