On 5.1.2007, at 12.59, The Manhatten Project wrote:

However it only ever highlights the first testlabel div, not them all,
which is is expected as ID's should be unique I guess.

Fabian already solved your problem, but...

Only a single element can have the same ID on a given page, that's what meant by id being unique. You cannot have multiple divisions with id "testlabel". Or you can, but it is invalid and JavaScript and CSS won't probably work correctly. Use the class attribute if you want to use it with multiple elements.

As for the other question you had later on, class="a b c" in an html element means that the element belongs to classes a, b and c. So as you noticed, it will be picked up by getElementsByClassName for any of those classes.

Cheers,
//jarkko

--
Jarkko Laine
http://jlaine.net
http://dotherightthing.com
http://www.railsecommerce.com
http://odesign.fi


Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to