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.dtd_input
http://www.w3.org/TR/xhtml1/dtds.html#dtdentry_xhtml1-transitional.dtd_select
http://www.w3.org/TR/xhtml1/dtds.html#dtdentry_xhtml1-transitional.dtd_textarea

~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/

Reply via email to