-----Original Message-----
From: [EMAIL PROTECTED] On Behalf Of Kornel Lesinski
Sent: Thursday, February 10, 2005 7:09 AM
To: wsg@webstandardsgroup.org
Subject: Re: [WSG] Not and IE bug?...follow up difference why a difference
between IDs and classes?
> 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

*****************************************************

While true all those points had already been mentioned and weren't the point
in any case. The point was that you can create links to parts of documents
using id:
www.mysite.com/mypage.html?id=#myidea

drew 
******************************************************
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