What does a colon mean within an HTML id attribute?

Ryan picture Ryan · Aug 23, 2010 · Viewed 12.7k times · Source

I have seen an HTML code like this for the ID attribute:

id="t1:c3"

Can someone explain this to me? What is the purpose of the colon (:)?

Thank you.

Answer

Chris Fulstow picture Chris Fulstow · Aug 23, 2010

Colons are allowed inside ID attributes, but hold no special significance. It's not really advisable to use them because they can sometimes cause problems, such as when used with jQuery or CSS, where the colon has special meaning as a pseudo-selector.