W3C home > Mailing lists > Public > www-html@w3.org > June 2003

Re: ID and NAME tokens (CDATA problems)

From: L. David Baron <dbaron@dbaron.org>
Date: Wed, 4 Jun 2003 11:31:34 -0700
To: www-html@w3.org
Message-ID: <20030604183134.GA28386@pool-141-158-29-100.phil.east.verizon.net>

On Wednesday 2003-06-04 14:16 -0400, Peter Foti (PeterF) wrote:
> However, I question whether the period should be allowed, as this is the
> character used to access properties in JavaScript/ECMAScript:

These tokens are used by attributes that have uses other than property
access in ECMAScript.  If using a certain character doesn't make sense
for a certain use, then you don't have to use it.

> There does not seem to be any way to access those input items using their
> names, because the dot notation:
> 
> document.myform.readme.txt-title

document.myform["readme.txt-title"] should work fine.  See ECMA-262
Edition 3 section 11.2.1.  (If you want to limit yourself to what is
required by the DOM HTML spec, though, you should use
document.forms["myform"]["readme.txt-title"] .)

-David

-- 
L. David Baron                                <URL: http://dbaron.org/ >
Received on Wednesday, 4 June 2003 14:35:35 GMT

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