[thelist] Re: apache monitor scripts

Stephen Rider evolt_org at striderweb.com
Wed Dec 15 14:40:45 CST 2004


On Dec 15, 2004, at 9:47 AM, Justin King wrote:
>> First, I have to note: you are assigning a single id to many divs in
>> the same page.  That is bad.
>
> Why is this? I don't usually do that, but I wouldn't have thought it 
> would
> matter, unless you are needing to try and get elements by id, which 
> (up to
> this point) I have not needed to do. Why is this such a bad idea? 
> everything
> renders correctly in IE and Firefox

By definition, a particular ID must be unique on a page.  Use "class" 
if you need to reference multiple elements by the same identifier.  
(This is the only real difference between class and id).

If you try to reference IDs using CSS some browsers will choke on 
multiples.  I'm guessing it might cause problems with javascript too, 
though I'm not much of a javascript guy -- others can tell you better 
than I.

Steve



More information about the thelist mailing list