Why can the same methods as HTMLElement be applied to an instance of Element?
HTMLElement inherits properties/methods from the Element interface. But, why on an instance of Element, it works even when I use the same properties and methods which are defined on HTMLElement. For example, in the given code, querySelector gives back Element which doesn’t have a style property defined on it (HTMLElement does). But, it works when… Read More Why can the same methods as HTMLElement be applied to an instance of Element?