views:

14

answers:

1

I've messed around with trying to detect how complex the query is (like if it's just an ID selector, it goes through getElementById instead and such) but this is clearly no way to do complex CSS queries and will probably fail on a certain few selectors.

So my question is to anyone who's done something similar, how did you end up replicating it for older browsers.

+2  A: 

Use jQuery? Or at least a selector library like Sizzle. No point in reinventing the wheel.

thenduks
Thanks, I forgot to mention that I'm making this for a personal project of mine that I'm trying to keep it as lightweight as possible. I might have to take a look through Sizzles source code though, I completely forgot it existed. Thanks!
philo23