That's kind of what I meant to say. >From my understanding, the CDATA rules apply if you are serving XHTML as application/xhtml+xml. If you are serving as text/html it is implied you are being backwards compatible, so you should go by the HTML4 rules where only A-z,0-9,._- characters are allowed.
Anyway I was just being picky. Everybody uses { in class attributes for metadata already, and most browsers (even the ones that don't support XHTML as application/xml) don't have a problem with that, I don't know how far down the chain that becomes a problem (IE5?). http://www.w3.org/TR/xhtml1/#C_8 What I really wanted to say is 'why are these lunatics putting brackets in IDs/names? there are plenty of unused/unmeaningful characters to choose' ;) - ricardo On Oct 21, 4:34 pm, jasonkarns <[EMAIL PROTECTED]> wrote: > In XHTML, the name attribute on input (and textarea and select) > elements is defined as CDATA not NMTOKEN thus, brackets are legal in > name attributes on input elements. It is NOT backwards compatible with > HTML, where the character restriction is [a-z][A-Z]-_ and . > > Further note, the id attribute has it's own separate set of > restrictions that are a subset of all HTML attributes. > > http://www.w3.org/TR/xhtml1/dtds.html#dtdentry_xhtml1-transitional.dt...http://www.w3.org/TR/xhtml1/dtds.html#dtdentry_xhtml1-transitional.dt...http://www.w3.org/TR/xhtml1/dtds.html#dtdentry_xhtml1-transitional.dt... > > ~Jason > > On Oct 21, 12:07 pm, ricardobeat <[EMAIL PROTECTED]> wrote: > > > Brackets are an invalid character in attributes, for XHTML served as > > text/html, which I guess accounts for most of jQuery usage anyway. > > Looks like someone already updated the docs. > > > - ricardo > > > On Oct 20, 11:36 pm, Ariel Flesler <[EMAIL PROTECTED]> wrote: > > > > We got a ticket about how to select elements by an attribute with > > > brackets. > > > I replied with the common link to the FAQ and the reporter replied > > > that the example in the docs doesn't work. > > > > I tried that myself, and indeed, that didn't work. > > > >http://dev.jquery.com/ticket/3443 > > > > $('[name=foo[bar]]'); // Doesn't work > > > > $('[name=foo\\[bar\\]]'); // Should work, but doesn't > > > > $('[name="foo[bar]"]'); // Does work > > > > Now... I think the last option is good enough. But we need to update > > > the docs. > > > > Anything to add ? > > > Anyone volunteers to update the docs ? > > > > Cheers > > > > -- > > > Ariel Fleslerhttp://flesler.blogspot.com/