How to get the body element in a html if body has no id ?

Feb

24

2013

Getting the body element in a html if body has no id

Tags: , , ,

In: D/HTML Asked By: [andrew] (Anonymously)
vote
Answer #1

I can think at 2 ways:

1. Easy, straightforward way:

document.body

2. complicated cumbersome way:

document.getElementsByTagName("body")[0]

Answers Answered By: alin [ Grey Star Level]

Answer this Question

Enter name & email to post an Answer. You can also Login / Join us

For a better management of this site please consider Logging in / Joining us before posting a Question. It makes everithing easier for us.

Please enter the captcha code bellow.
Logged in users don't have to use captchas. Don't have an account? Join us!

 

Link Exchange:

You can add url to the best of the internet directory. Our url is added under Reference Directory
HE Blog Directory WEB LOG SHOWWEB LOG SHOW