[Javascript] Check if ID exist

Matt Warden mwarden at gmail.com
Fri Aug 18 14:03:35 CDT 2006


On 8/18/06, Peter Lauri <lists at dwsasia.com> wrote:
> [snip]
> There is no such method, it is "Element", not "Elements", and (in a
> given document) no two elements may share the same id.
> [/snip]
>
> There are many designers who use the ID for the CSS property, where it
> should not be used. That is logical not good to have multiple ID, but if you
> do not have any JavaScript running on the page it still works :)

The proper attribute to group a class of elements together is...
class. It is not a CSS/JS property. It is a logical grouping, just as
ID is a *unique* identifier.

The blink tag works in some browsers too. Doesn't mean you should use
it. And I certainly see no reason to duplicate IDs when you can simply
use class.

-- 
Matt Warden
Cleveland, OH, USA
http://mattwarden.com


This email proudly and graciously contributes to entropy.



More information about the Javascript mailing list