Re: How do I get the object type from document.all?
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.javascript archive

Re: How do I get the object type from document.all?

From: RobG <rgqld@iinet.net.auau>
Date: Sun Aug 14 2005 - 13:58:03 CEST

seans wrote:
> Hi,
>
> Please, can somebody tell me how to do this?
>
> I am using document.all in a script to retrieve the elements in a
> document which have a certain id. document.all returns a reference to
> an element or an array. If the id is unique within the document then
> document.all returns a reference to the element. If there is more than
> one element with the same id then an array is returned.

Having multiple instances of the same ID will make your HTML invalid.
ID's must be unique within a page.

And unless your page is for IE only, use DOM compliant methods and
feature detection:

    <URL:http://www.jibbering.com/faq/#FAQ4_15>

[...]

-- 
Rob
Received on Mon Oct 24 02:14:05 2005