Friday, September 14, 2018

jawdropper - every id'd DOM element is a variable?

I had no idea, or had utterly forgotten, that every DOM element with an id attribute is available as a variable, seemingly plucked from global space and I guess rendering document.getElementById() almost useless- here's the jsbin link from that tweet.

I forget just how "scripty" Javascript is sometimes, and understand its detractors a bit more (though I am not one of them)

No comments:

Post a Comment