this is partially correct.
the name attribute is only valid on the <form> and form elements
(<input>,<textarea> and <select>). it used to specify the name to assoicate
with the name/value pair that is submitted on a form post.
for example:
<input type=checkbox name=foo value=1>
if checked will submit foo=1. in the dom you can reference form elements
from the form.elements collection by specifing the name as the index. if is
not unique, the collection returns an array of elements rather than the
element. modern dom's support looking up form elements by name as:
document.getElementsByName(nameValue)
note: it always returns an array even if only one element is found.
id attribute is from the xml world, and is a unique id for any node, not
just form elements. unlike the name attribute it is valid on any html node.
also like the name attribute, it must follow the valid identitfier rules.
the identitfer should start with an alpha, and only contain alpha
([a-zA-Z]), numbers, hyphen, underscore and colons.(note aspnet breaks this
rule by starting reserved ids with a underscore - thus they will alway fail
an html/xml lint - actually some proxies strip them). to find any html
element by id you use:
document.getElementById(idvalue)
this only returns one dom node.
-- bruce (sqlwork.com)