`id` should be unique for a well-formed HTML, so it should have the same precision. `getElementById` is very efficient, since it's a direct lookup without having to iterate the DOM tree (I would have thought the xpath would have been optimized internally though) http://jsperf.com/getelementbyid-vs-queryselector/4