W3C home > Mailing lists > Public > www-dom@w3.org > April to June 1998

Named access to elements

From: Antoine Bertier <antoine.bertier@axa.com>
Date: Tue, 30 Jun 1998 15:14:22 +0200
Message-ID: <3598E4AD.4DDD5ACE@axa.com>
To: www-dom@w3.org
Hello everybody,

I am trying to understandand how the DOM provides named access to
elements, at least HTML elements but why not to core elements too.

The IDL for  HTMLElement specifies an 'id' attribute, which I assumes
has the same semantics as the HTML 4.0 ID attribute. For the IMG element
specifies a 'name' attribute for compatibility reasons.

I see the images() methods to get a NamedNodeList which I assumes allows
to find an IMG element by its 'name' attribute or by its 'id'
attribute... The same goes for applets, links, forms and anchors.

However since all elements have an ID in HTML 4.0 I expect to be able to
access any element by its document wide ID (DIV elements for instance).
How do I do that ?

I would like to explain to developpers how the code they used to write
for the various browsers should be written with the DOM. Since there has
never been a NAME attribute on IMG in standard HTML I would like to
emphasize the use of ID and point out its advantage or uniform semantics
for all elements. This does not really make sense without a named access
to all elements.

Thanks for your help,

Antoine Bertier
antoine.bertier@axa.com
Received on Tuesday, 30 June 1998 09:19:24 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:13:45 GMT