So I was playing around with document
in JavaScript, as an alternate way of using document.getElementById
. But why does document.all
equal null
? I ran a few commands to prove it's even more 'falsy'.
document.all // HTMLAllCollection[1276]
document.all[0] // <html>...</html>
typeof document.all // 'undefined'
!{} // false. works correctly
!document.all // true! WTF
What is this? Other objects work fine. What happened to the document.all
object? Is it broken?