C
Chamomile
For simplicity in referencing elements ( in this case div's) for
manipulating with javascript I have been using an array as the value for
id's.
eg:
<div id='mydiv[0]' >my div 0</div>
<div id='mydiv[1]'>my div 1</div>
this works fine even using 2 dimensional arrays for some fairly complicated
stuff..
However, one 'section' of a page started giving javascript errors (IE6)
although it used an identical code style.
After exhaustive cheking for the usual errors with no obvious culprits I ran
the page through a validator with the result that I had line after line of
complaints from the validator that the '[' character could not be used in an
id value.
If that's the case then why do some work? Can one really not use an array
member as an id?
manipulating with javascript I have been using an array as the value for
id's.
eg:
<div id='mydiv[0]' >my div 0</div>
<div id='mydiv[1]'>my div 1</div>
this works fine even using 2 dimensional arrays for some fairly complicated
stuff..
However, one 'section' of a page started giving javascript errors (IE6)
although it used an identical code style.
After exhaustive cheking for the usual errors with no obvious culprits I ran
the page through a validator with the result that I had line after line of
complaints from the validator that the '[' character could not be used in an
id value.
If that's the case then why do some work? Can one really not use an array
member as an id?