oh, right. Didnt really think that one over very much :P Still though, i
would use $('#warningmsg')[0], it seems like the safest choice.
On 1/19/07, Mike Alsup <[EMAIL PROTECTED]> wrote:
> That would still be a bad way to do it i'd say, because if theres more
than
> one element with the id 'warningmsg' (I know there shouldnt be, but you
cant
> count on these things), it would fire more than once. I would just use
if
> ($('#warningmsg')[0]).
Not true. If you have multiple elements with the same id and you use
id selection syntax (#), your result set will contain a single element
(the first one). jQuery uses getElementById (for html docs) to
resolve those queries.
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/