0

I have two divs. One has an id that is a string representation of a long number. The other is a shorter string. If I use the YUI selector to query for these divs, it fails to find the one that has the long number as it's id.

Here's the jsfiddle:

Why does it not find the first div?

gdoron
  • 147,333
  • 58
  • 291
  • 367
septerr
  • 6,445
  • 9
  • 50
  • 73

1 Answers1

1

Id can't start with a number, that's all.

Change from:

<div id='13367716691470000' style='display:none;'>test</div>

To:

<div id='foo13367716691470000' style='display:none;'>test</div>

Updated Fiddle

ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), and periods (".").

source

gdoron
  • 147,333
  • 58
  • 291
  • 367