W3C home > Mailing lists > Public > www-html@w3.org > November 2002

name / id attribute usage

From: <mccarthy36@earthlink.net>
Date: Sun, 24 Nov 2002 14:45:01 -0500
Message-ID: <244640-220021102419451939@M2W089.mail2web.com>
To: www-html@w3.org

There is a great deal of confusion surrounding the appropriate usage of the
'name' and 'id' attributes.  As you are probably aware, some existing
(popular) user agents do not properly treat the 'id' value as the control
name of a form element (e.g. 'input'), so it is a practicaly necessity to
use the 'name' attribute.  By the same token, the id attribute must be used
to identify elements for styling purposes.

In 12.2.3 of HTML 4.01 it says (regarding the 'name' and 'id' attributes):
"It is permissible to use both attributes to specify an element's unique
identifier for the following elements: A, APPLET, FORM, FRAME, IFRAME, IMG,
and MAP."

This section is about fragment identifiers.  Although it does not say so,
is this statement true only in context when using 'name' / 'id' to create
fragment identifiers?  Or is it true in general, precluding the
simultaneous use of 'name' and 'id' on, say, an 'input' element?

If that is the case, it prevents one from authoring a valid document which
will function in existing user agents while doing the following:
* naming a control
* uniquely identifying that same control for styling


Furthermore, in 4.10 of XHTML 1.0 it says (once again regarding 'id' and
'name' used as fragment identifiers):
"HTML 4 defined the name attribute for the elements a, applet, form, frame,
iframe, img, and map."

This omits at least one element, 'input', for which 'name' is also defined
in HTML 4.  Is this list supposed to be interpreted in the context of
fragment identification?  If so, the wording should be changed to make that
explicitly clear.  Otherwise, the list should be given correctly.

** PLEASE CC to my address -- I am not subscribed to the list **
Jesse McCarthy



--------------------------------------------------------------------
mail2web - Check your email from the web at
http://mail2web.com/ .
Received on Sunday, 24 November 2002 15:51:07 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 27 March 2012 18:15:53 GMT