Re: ID and NAME tokens (CDATA problems)

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 UTC