HTML DOM Notes

Accessing Elements

Changing HTML Elements

DOM Events

Assign Events Using DOM

document.getElementById(id).onclick = displayDate;

onload and unload events

triggered when user enters or leaves page

onchange event

used in combo with validation of input
ex: input type='text' id='fname' onchange='uppercase()'

mouse-click events

Passing Parameters

JS Output

Event Propagation

bubbling

innermost element event handled first, then outer

capturing

outer most element event handled first, then inner

this can be specified with the 'useCapture' parameter

default value is false, which will use bubbling

DOM Node Classes

Node Lists

HTML DOM Collections

Animation

Arrow Function

this

represents the owner of the function

Regular Function

this

represents the object that calls the function

Forms

form validation

constraint validation

clientWidth vs. innerWidth

clientWidth is smaller than innerWidth
CW - includinng padding, without the scrollbar. also include scrolled-out invisible parts of element. Provides the visible part of the document available for content.
IW - includes the scrollbar.

get date