DEV Community

Discussion on: Do's and Don'ts for Javascript Newbies

 
mr21 profile image
Thomas Tortorini

Because it's seems not standard :/ but you can easely recreate this idea:

document.querySelectorAll("[id]").forEach(el => window[el.id] = el);

Thread Thread
 
qm3ster profile image
Mihail Malo

It's totally standard.