哪个原型用于创建带有未知标签的节点
Which prototype is used for creating a node with an unknown tag
我想知道什么时候我创建了一个未知的 HTMLElement,比如 apple-tag:
var apple = document.create("apple")
我会对它是由哪个原型制成的感兴趣...
因为我试过:
apple.isPrototypeOf(HTMLElement.prototype)
console: false
我的问题是什么原型用于未知标签。
谢谢!
您问题的答案是 HTMLUnknownElement
。它是 HTMLElement
.
的子类
var myApple = document.createElement('apple');
document.write(myApple.constructor.name); // "HTMLUnknownElement"
我想知道什么时候我创建了一个未知的 HTMLElement,比如 apple-tag:
var apple = document.create("apple")
我会对它是由哪个原型制成的感兴趣... 因为我试过:
apple.isPrototypeOf(HTMLElement.prototype)
console: false
我的问题是什么原型用于未知标签。
谢谢!
您问题的答案是 HTMLUnknownElement
。它是 HTMLElement
.
var myApple = document.createElement('apple');
document.write(myApple.constructor.name); // "HTMLUnknownElement"