3 ms·
DOM elements with ID's are global variables
- combatentropy 9y agoGreat find! Not only do element IDs become global variables but so do names if they're on one of these tags: embed, form, img, and object. At least it happened when I tested in Firefox and Chrome (I didn't test it in Internet Explorer). The standard also says that it should happen for the name attribute on a frameset element, but that didn't work when I tried. https://html.spec.whatwg.org/#named-access-on-the-window-object https://html.spec.whatwg.org/#named-access-on-the-window-obj...