On Jun 17, 8:34 am, "Mislav Marohnić" <[EMAIL PROTECTED]>
wrote:
> Am I right when saying that this will fail if the ID was dynamically set (in
> other words, it was not an attribute in HTML source)?

Adam's test is correct -- even dynamically-set ID attributes will
still be picked up by readAttribute in IE.

As for the difference between $('*').detect and $('*[id=foo]'): the
second is much faster in IE. The first must past each element on the
page through Element.extend. The second will extend only the matched
element.

I suggest using Element.down, since it always returns one node:

return $(document.body).down('*[id=foo]');


Cheers,
Andrew


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype: Core" group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to