Bite code
Bite code

Reputation: 596633

What are the issue with putting markup outside <body>?

I have a bookmarklet storing a lot of DOM data, but I would love to avoid to put them out of the body tag so the script in the page won't mess with it.

Semantic value is not an issue for once, but I would like to know :

Upvotes: 0

Views: 251

Answers (2)

Bite code
Bite code

Reputation: 596633

Result of some little testing :

  • Firefox won't display a big red DIV if it's after </body>
  • Firefox won't run alert() from a SCRIPT if it's after </body>
  • Firebug don't see them but display the famous Firebug DIV after </body>

Upvotes: 0

Eli Grey
Eli Grey

Reputation: 35830

Everything inside the <html> tag (even if outside the <body> tag) can be accessed via document.documentElement.

Upvotes: 4

Related Questions