So the code below will get the开发者_运维知识库 ID of the BODY elementL
var bodyId = document.body.id;
How can I get the ID of the HTML element using plain ole' JavaScript?
document.documentElement.id
document.getElementsByTagName('HTML')[0].id
So the code below will get the开发者_运维知识库 ID of the BODY elementL
var bodyId = document.body.id;
How can I get the ID of the HTML element using plain ole' JavaScript?
document.documentElement.id
document.getElementsByTagName('HTML')[0].id
精彩评论