1

I was looking through gmail's source code in chrome and noticed that some elements have:

<div class="TO" id=":6e">stuff</div>

<div class="TO" id=":6f">other stuff</div>

I've never seen the use of ":" inside the ID. What's that for?

  • possible duplicate of [What does a colon mean within an HTML id attribute?](http://stackoverflow.com/questions/3544898/what-does-a-colon-mean-within-an-html-id-attribute) – showdev Jan 14 '15 at 23:23
  • possible duplicate of [Can an ID attribute start with colon?](http://stackoverflow.com/questions/10713121/can-an-id-attribute-start-with-colon) – Gergo Erdosi Jan 14 '15 at 23:24

2 Answers2

4

They're just (valid) id's.

There are no other restrictions on what form an ID can take; in particular, IDs can consist of just digits, start with a digit, start with an underscore, consist of just punctuation, etc.

http://www.w3.org/html/wg/drafts/html/master/dom.html#the-id-attribute

Jonathan
  • 8,771
  • 4
  • 41
  • 78
  • Thanks @Jonathan for some reason I thought ID's had to be alphanumerical –  Jan 14 '15 at 23:25
  • 1
    In **HTML4** an `ID` had to start with a-z/A-Z (though did allow certain special characters after it) – Jonathan Jan 14 '15 at 23:26
0

This is a guess - but aside from the benefits of heavy minimizing and obfuscating that Google does, it also just happens to be a good anti-adblock tactic. If you're an avid fan of AdBlock, it's very hard to uniquely isolate an html element if the ids and classes are effectively random.

fnostro
  • 4,531
  • 1
  • 15
  • 23