By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,528 Members | 1,375 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,528 IT Pros & Developers. It's quick & easy.

if(document.all)

P: n/a
Hi,

What does all mean in if(document.all)? I could not find an object
called all in the page.

Thanks
Jul 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
ym*@kicon.com (chirs) writes:
What does all mean in if(document.all)? I could not find an object
called all in the page.


Microsoft's Internet Explorer has a proprietary property of the document
object that is called "all".
Writing
if (document.all)
tests whether this property is present.

Some believes that the presence of document.all implies that the
browser is IE. That is no longer the case, since some other browsers
have also implemented it. The only thing you can really assume after
such a check, is that document.all exists (or doesn't).

In IE, document.all is an "HTML Collection" containing all elements
of the page. You can write
document.all['foo']
to get a reference to the element with ID="foo". The offical way
to do that is
document.getElementById("foo")
and it is supported by IE from version 5.

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.