The methods querySelector(), querySelectorAll(), getElementsByTagName(), and you will getElementsByClassName normally utilized regarding document target are defined on ability nodes. This allows for these answers to restrict its brings about particular vein(s) of your own DOM tree. Otherwise told you various other, you could see a specific context where you would like the methods to search for element nodes by the invoking these processes on element node things.
These methods not simply run using new real time dom but programatic DOM formations which can be created in code also.
4.5 Pre-set up selections/listing from function nodes
You ought to know there are some heritage, pre-designed arrays-like-lists, with element nodes out-of an enthusiastic HTML document. Lower than I number a few such (perhaps not the complete record) that would be helpful to be aware of.
- document.the – all points within the HTML document
- document.forms – all
- document.images – all elements in HTML document
- document.links – all elements in HTML document
- document.scripts – all