Skip to content

Instantly share code, notes, and snippets.

@telegraham
Last active August 5, 2019 20:12
Show Gist options
  • Save telegraham/2cc7331ae510bf76698bd25775c88dca to your computer and use it in GitHub Desktop.
Save telegraham/2cc7331ae510bf76698bd25775c88dca to your computer and use it in GitHub Desktop.

Manipulating the DOM with JavaScript Chart

Selector name Return shape Return type Live? Reference can i call forEach?
document.getElementById() Single element Element N/A https://goo.gl/8cHGoy N/A
element.getElementsByClassName() Collection HTMLCollection Yes https://goo.gl/qcAhcp No
element.getElementsByTagName() Collection HTMLCollection Yes https://goo.gl/QHozSh No
element.querySelector() Single element Element N/A https://goo.gl/6Pqbcc N/A
element.querySelectorAll() Collection NodeList No https://goo.gl/vTfXza Yes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment