I'm learning vanilla js and something that keeps coming up is that I see some examples of code that say document.getElementBy... or document.getElement(s)By..., Is it the case that every html node has a corresponding js dom form where getElementBy refers to a single node and getElementsBy refers to a nodeList?
Principal element gathering methods from the DOM API are:
document.getElementById('[ID]')
// returns live HTML Element Objectdocument.getElementsByClassName('[CLASS]')
// returns live HTML Collection Objectdocument.getElementsByName('[NAME]')
// returns live HTML Collection Objectdocument.getElementsByTagName('[ELEMENT-TYPE]')
// returns live
HTML Collection Objectand
document.querySelector('[CSS-SELECTOR]')
// returns static HTML Element Objectdocument.querySelectorAll('[CSS-SELECTOR]')
// returns static NodeList Object