Zlatej kluk
Zlatej kluk
KPCKevin Powell - Community
Created by Zlatej kluk on 9/19/2023 in #front-end
DOM under the hood
Hello guys, I am confused about the DOM and have several questions. DOM is just specification for browsers developers that specifies necessary interfaces? The specification is implemented by browser internally in low-level language? Browser gives us host objects, constructed prototypal chain where EventTarget is root class from which descendant classes like Element, Node, HTMLElement inherits? How it is possible that document.querySelector('div') returns element and that element has [[Prototype]] property with constructor function HTMLDivElement(), but I can't use that constructor directly like const div = new HTMLDivElement(). Interface in programming world is something like blueprint that only says which methods, properties should something have to implement this interface? So every class, object, method, etc. is constructed in browser internally in some low-level language and we get it accessible through javascript? I am just curious how it works under the hood. Thank you for every helpful resource or explanation.
22 replies