Who needs consensus? All we need is a test :-)  :

http://test.learningjquery.com/multipleid.html


--Karl
_________________
Karl Swedberg
www.englishrules.com
www.learningjquery.com



On May 18, 2007, at 2:01 PM, [EMAIL PROTECTED] wrote:


Just wanted to get consensus, will this work

if ($('[EMAIL PROTECTED]').length == 2) {
   // do something ?

}


?  Thanks, - Dave


On May 18, 9:07 am, Karl Swedberg <[EMAIL PROTECTED]> wrote:
You could try this:

if ($('[EMAIL PROTECTED]').length == 2) {
   // do something ?

}

That selector will probably be a little slow, though, depending on
the complexity of the DOM, because it has to crawl through every
single element. if you can narrow it down to within a certain div,
that would help alleviate possible speed bumps.

Cheers,

--Karl
_________________
Karl Swedbergwww.englishrules.comwww.learningjquery.com

On May 18, 2007, at 9:55 AM, [EMAIL PROTECTED] wrote:



Hi,

How can I use JQuery to discover if a particular ID occurs twice in my
page?  I can't use "View Source' because the DOM is changing as the
user interacts with the page.

Thanks, - Dave


Reply via email to