Does duplicate id's screw up jquery selectors?

Posted by Matt on Stack Overflow See other posts from Stack Overflow or by Matt
Published on 2009-06-27T23:53:59Z Indexed on 2010/04/26 0:13 UTC
Read the original article Hit count: 163

Filed under:
|
|
|

If I had two divs, both with id="myDiv"

Would $("#myDiv").fadeOut(); fade both divs out? Or would it fade only the first/second? Or none at all?

How do I change which one it fades out?

Note: I know duplicate id's is against standards but I'm using the fancybox modal popup and it duplicates specified content on your page for the content of the popup. If anyone knows a way around this (maybe I'm using fancybox wrong) please let me know.

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about fancybox