checks if element matches selector