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 is supporting Monica
  • 142,542
  • 55
  • 282
  • 355
septerr
  • 6,257
  • 9
  • 47
  • 67

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 is supporting Monica
  • 142,542
  • 55
  • 282
  • 355