On Fri, Mar 18, 2011 at 3:13 AM, Matt Kruse <[email protected]> wrote: > On Mar 17, 5:17 pm, Diego Perini <[email protected]> wrote: >> This (3) seems to me the best solution but use >> "compareDocumentPosition()" method instead. > > I just learned of this method today. Very handy! > >> maybe you could use method 2 and "matchesSelector()" to avoid using an >> expensive >> universal "*" selector if you need to match an object reference with a >> selector string. > > Is there browser support for this? I see that mozMoatchesSelector() > and webkitMatchesSelector() exist. I guess I need to do some browser > testing... >
Yes, "matchesSelector()" is supported in all new browsers even in IE9. Naming is a bit different in each implementation: webkitMatchesSelector (Webkit) mozMatchesSelector (Mozilla) msMatchesSelector (MS) matchesSelector (W3C) -- Diego > Matt Kruse > > -- > To view archived discussions from the original JSMentors Mailman list: > http://www.mail-archive.com/[email protected]/ > > To search via a non-Google archive, visit here: > http://www.mail-archive.com/[email protected]/ > > To unsubscribe from this group, send email to > [email protected] > -- To view archived discussions from the original JSMentors Mailman list: http://www.mail-archive.com/[email protected]/ To search via a non-Google archive, visit here: http://www.mail-archive.com/[email protected]/ To unsubscribe from this group, send email to [email protected]
