例如,下面这个最常见的html文件。
foo.html
Object.prototype.toString.call(document)
//return “[object HTMLDocument]”
document.documentElement表示取得对的引用
Object.prototype.toString.call(document.documentElement)
//return "[object HTMLHtmlElement]
你还可以取得body,doctype,title,URL,domain等的引用,例如
document.body
document.doctype
…
注意doctype,可以帮助你理解二者的不同。