RE: Convenient way to create element and set its attributes at once
Domenic Denicola <[email protected]>
| Newsgroups | gmane.comp.web.dom.general |
|---|---|
| Message-ID | <4ac4f77dcf2a40c08129c44e7911b24a@BN1PR05MB325.namprd05.prod.outlook.com> |
From: Tab Atkins Jr. <[email protected]> > HTML.h1 = function(...args) { return new HTMLHeadingElement("h1", ...args); }; > HTML.h1.prototype = HTMLHeadingElement.prototype; Seems OK, but why not just HTML.h1 = function(...args) { return new HTMLHeadingElement("h1", ...args); }; and don't call it with `new`? Having multiple constructors for the same prototype feels ... unusual ...