开发者

How to get <body> in *X*HTML where document.body is missing

What is the "official" way to ge开发者_开发知识库t the <body> element in XHTML (=~XML) web page where there is no document.body? I mean something better than quering it through querySelector or getElementsByTagName which I consider ugly.

EDIT: It doesn't work for me in Firefox 3.6 when in strict XHTML mode.


document.body is an official, standard property and is part of DOM2. In addition, all browsers today support it.


I had a XML document. One should switch from application/xml to application/xhtml+xml.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜