I'm working with an HTML document that uses a lightbox implementation for image viewing, and for reasons relating to its API it uses the same element ID in two spots-- one for the thumbnail view and one for the lightbox/full view. (These elements are in separate <div>
tags.)
The two elements have different class values, and I was wondering how to differentiate them when writing selectors? Is it something like #myElementWithDuplicateID.className1
and #myElementWithDuplicateID.className2
?
In general, is it bad practice to use the same ID for different elements on a page, or are there situations for doing it I'm not aware of?