Accessing HTML Elements
id, class, tag, query, query all
getElementById('demo')
getElementsByClassName('demo')
getElementsByTagName('article')
querySelector('.query')
querySelectorAll('[role=demo]')
[role=demo]
[role=demo]
[role=demo]
createElement('button')
Create Button
createTextNode('hello')
Create Text Node
innerHTML
Change inner HTML
setAttribute('src', 'url')
style.backgroundColor
Change style
Modifying nodes
append, remove, replace, insert before
appendChild('li')
Append List Item
removeChild('li')
Remove List Item
replaceChild('li')
Replace List Item
Traversing the DOM
first child, last child, previous sibling, next sibling, childNodes
Click on the green element to see the related elements.