Yeah I know that, but consider this situation:

Two different kinds of pages each have an element with the same ID.  I want
my Javascript to only affect the element on one of those pages.  So I
precede the ID with the class name I use for that page type, to target the
right one.  Isn't this a reasonable use case?

Jennifer


Giuliano Marcangelo wrote:
> 
> Jennifer,
> 
> I am far from being an expert, but as you know an id must be
> unique..........therefore .myClass #myId is not necessary to target
> #myId.........surely you should only target the "id"....same with
> "#firstId
> #secondId"........simply declare the id that you wish to target
> 
> hth
> 
> On 25/01/07, jgrucza <[EMAIL PROTECTED]> wrote:
>>
>>
>> I have a somewhat similar problem with ID selectors, and I posted a
>> message
>> about it and a bug but so far I haven't gotten a single response from
>> anyone
>> (here's the bug: http://jquery.com/dev/bugs/bug/881/).
>>
>> My problem is IDs preceded by a class or another ID (i.e. ".myClass
>> #myId"
>> or "#firstId #secondId").  It's causing an exception in the jquery code
>> on
>> this line:
>>
>>    if ( m[1] == "#" && ret[ret.length-1].getElementById ) {
>>
>> I don't know if it's related to yours or not.
>>
>> -Jennifer
>>
>>
>>
> 
> _______________________________________________
> jQuery mailing list
> [email protected]
> http://jquery.com/discuss/
> 
> 

-- 
View this message in context: 
http://www.nabble.com/simple-selector-with-ID-doesn%27t-work-anymore-tf3080046.html#a8640644
Sent from the JQuery mailing list archive at Nabble.com.


_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to