Today I Learned

hashrocket A Hashrocket project

Element id's pollute the window namespace

Given a page with <div id="blah"></div>

If you open a console and log window.blah with console.log(window.blah); you'll get a reference to that DOM node where you'd expect to get undefined.

This is bad, and my whole life is a lie.

/ht @rwjblue

See More #javascript TILs
Looking for help? At Hashrocket, our JavaScript experts launch scalable, performant apps on the Web, Android and iOS. Contact us and find out how we can help you.