Related is the IDs for <form> elements: if you use <input id="foobar"> you can access foobar from DOM via form.foobar. This is OK until you use <button id="submit">, then all codes relying on form.submit() function does not work anymore (prototype function overshadowed by object property).
I stumped on the "feature" a while ago. I don't know if this behaviour is documented anywhere in the DOM specification. Might as well if somebody is working on a linter for HTML/DOM-related stuff, add a rule to disallow id which is names from Element or Window object.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Related is the IDs for
<form>
elements: if you use<input id="foobar">
you can access foobar from DOM via form.foobar. This is OK until you use<button id="submit">
, then all codes relying onform.submit()
function does not work anymore (prototype function overshadowed by object property).I stumped on the "feature" a while ago. I don't know if this behaviour is documented anywhere in the DOM specification. Might as well if somebody is working on a linter for HTML/DOM-related stuff, add a rule to disallow id which is names from Element or Window object.