W3C home > Mailing lists > Public > www-html@w3.org > September 2001

RE: NAME or ID ?

From: Clover Andrew <aclover@1value.com>
Date: Tue, 18 Sep 2001 20:14:52 +0200
Message-ID: <D58B0195B58937489E89124469E57CA20D3C4C@EX1.1value.com>
To: <www-html@w3.org>
James Craig <james_craig@Powered.com> wrote:

> ('id' doesn't work correctly in netscape 4)...

As an anchor, no it doesn't. It's fine for identifying things to CSS and
in document.layers though.

> also, some server side languages (php, for example)
> will not catch form variables if they are listed with the
> 'id' attribute.

This is to do with the browser, not the server-side scripting language.
Confronted with:

  <input type="text" id="foo" value="bar">

Browsers do not and should not submit "foo=bar" to a script. 'name' is
still used here for form control names; 'id' has a different meaning.

> so in theory, 'name' is deprecated and should not be used. 

Only the identifying uses of 'name' such as <a> and <img>. This usage of
'name' to identify a particular part of the page is now superceded by
the 'id' attribute, which can occur on any element.

<meta name>, <param name> and <input|select|textarea|button|object name>
are entirely unrelated and should still be used. Hopefully the
separation of the identifying-uses from other uses of 'name' may reduce
confusion, when older browsers like N4 disappear.

Andrew Clover
Technical Consultant
Received on Tuesday, 18 September 2001 14:18:18 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:05:58 UTC