On 6/28/13 5:06 PM, Tab Atkins Jr. wrote:
getElementById("foo") is just querySelector("#foo")
This is actually false. For example, getElementById("foo:bar") is just querySelector("#foo\\:bar"), which is ... nonobvious.
It gets worse if you don't control the id that's passed in, because getElementById(arg) becomes querySelector("#"+cssEscape(arg)) where cssEscape is a not entirely trivial-to-write function, if you want it to work reliably.
-Boris
