返回列表

DOM探秘

默认分类 2014/08/28 08:51

Chrome

Object.getPrototypeOf(a)
>> HTMLDivElement {click: function, getAttribute: function, setAttribute: function, removeAttribute:function, getAttributeNode: function…}
Object.getPrototypeOf(Object.getPrototypeOf(a))
>> HTMLElement {click: function, getAttribute: function, setAttribute: function, removeAttribute:function, getAttributeNode: function…}
Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototypeOf(a)))
>> Element {getAttribute: function, setAttribute: function, removeAttribute: function,getAttributeNode: function, setAttributeNode: function…}
Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototypeOf(a))))
>> Node {insertBefore: function, replaceChild: function, removeChild: function, appendChild:function, hasChildNodes: function…}Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototypeOf(a)))))
EventTarget {addEventListener: function, removeEventListener: function, dispatchEvent: function}Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototypeOf(a))))))
>> Object {} 

Firfox

a.__proto__
>> HTMLDivElementPrototype { ELEMENT_NODE=1, ATTRIBUTE_NODE=2, TEXT_NODE=3, more...}
a.__proto__.__proto__
>> HTMLElementPrototype { ELEMENT_NODE=1, ATTRIBUTE_NODE=2, TEXT_NODE=3, more...}
a.__proto__.__proto__.__proto__
>> ElementPrototype { ELEMENT_NODE=1, ATTRIBUTE_NODE=2, TEXT_NODE=3, more...}
a.__proto__.__proto__.__proto__.__proto__
>> NodePrototype { ELEMENT_NODE=1, ATTRIBUTE_NODE=2, TEXT_NODE=3, more...}
a.__proto__.__proto__.__proto__.__proto__.__proto__
>> EventTargetPrototype { addEventListener=addEventListener(), removeEventListener=removeEventListener(), dispatchEvent=dispatchEvent()}
a.__proto__.__proto__.__proto__.__proto__.__proto__.__proto__
>> Object {}

IE

Object.getPrototypeOf(document.body) 
>> [object HTMLBodyElementPrototype] {} 
Object.getPrototypeOf(Object.getPrototypeOf(document.body)) 
>> [object HTMLElementPrototype] {} 
Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototypeOf(document.body))) 
>> [object ElementPrototype] {} 
Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototypeOf(document.body)))) 
>> [object NodePrototype] {} 
Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototypeOf(document.body))))) 
>> [object Object]