The ways querySelector(), querySelectorAll(), getElementsByTagName(), and getElementsByClassName usually accessed from the document target are defined towards element nodes. This allows of these solutions to limitation their leads to specific vein(s) of DOM forest. Otherwise said various other, you might see a certain perspective in which you want the methods to find element nodes by invoking these processes towards element node items.
These methods not only run using the fresh real time dom but programatic DOM structures which can be created in code too.
4.5 Pre-configured choices/listing regarding function nodes
You should be aware that we now have some heritage, pre-set up arrays-like-listings, that features function nodes of an enthusiastic HTML file. Below I checklist a couple of this type of (not the whole list) that would be handy to be aware of.
- file.every – all of the facets during the HTML document
- document.forms – all
- document.images – all elements in HTML document
- document.links – all elements in HTML document
- document.scripts – all