You can use the matches()
method.
Support can be found at http://caniuse.com/matchesselector
But since it is still a draft, all browsers implement it with a prefix
element.msMatchesSelector( selector )
(IE)element.mozMatchesSelector( selector )
(mozilla)element.webkitMatchesSelector( selector )
(webkit)element.oMatchesSelector( selector )
(Opera)