Handling query and queryselector at the some time.