Maybe one can do this, as jQ author writes: "weird characters in its
ID" . But this is a bad programming practice.
Why would anyone do that?  When was the last time (if ever) you did
that? If Matt Brenna want to do some indexing of some elements there
are much safer,scaleable and robust ways to do this. Like using data()
method etc ... Or in a spirit of HTML5, and to be 'future proof' one
might do something like this :

<input type="text" data-no="1" data-tag="firstname" />
<input type="text" data-no="2" data-tag="firstname" />

And before HTML5 browsers become mainstream Matt can use jQuery :

$("input[data-no=1][data-tag=firstname]")

This in my mind is the right kind of advice to give to (jQ) beginers
(no offence Matt ;o). But again I have to remind you: this forum is
not a place for that.

Also I could not make this work :

// function from Frequently_Asked_Questions
function jq(myid) { return '#'+myid.replace(/:/g,"\\:").replace(/\./
g,"\\.");}

$(document.body).append("<div id='A[2]' ></div>") ;
$(jq("A[2]")).length
/*
0
*/

It must be something obvious but I do not see it ?

-- DBJ



On Apr 16, 1:03 pm, "Richard D. Worth" <rdwo...@gmail.com> wrote:
> On Wed, Apr 15, 2009 at 12:23 PM, Daniel Friesen
> <nadir.seen.f...@gmail.com>wrote:
>
>
>
> > Fact is that jQuery does support using characters like :[] by escaping
> > them with a \ and that should be noted when someone does not know.
>
> It's noted here:
>
> http://docs.jquery.com/Frequently_Asked_Questions#How_do_I_select_an_...
>
> - Richard
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jQuery Development" group.
To post to this group, send email to jquery-dev@googlegroups.com
To unsubscribe from this group, send email to 
jquery-dev+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to