On Thu, 10 Feb 2005 06:40:49 -0500, Trusz, Andrew <[EMAIL PROTECTED]> wrote:

newbie questions... What is the advantage of the fact that IDs must be
unique on a page?

1. getElementById() works.
2. Validation. If you use <div id="maincontent">, validator will complain when you have two or more such divs (typical copy&paste accident :)


Additionally IDs have higher priority than class in CSS, so it's easier to make "local" styles for element with an ID than with a class.

--
regards, Kornel Lesiński

******************************************************
The discussion list for  http://webstandardsgroup.org/

See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list & getting help
******************************************************



Reply via email to