RE: Convenient way to create element and set its attributes at once
Domenic Denicola <[email protected]>
| Newsgroups | gmane.comp.web.dom.general |
|---|---|
| Message-ID | <4ea42fa769004a018948fccfc202acb4@BN1PR05MB325.namprd05.prod.outlook.com> |
From: Rick Waldron [mailto:[email protected]] > Yes, and it's not just you-the "single function/constructor/method that accepts a string and produces a node" is a common pattern implemented by all major libraries: > > Y.Node.create("<div>"); > jQuery("<div>"); > dojo.create("div"); > new Element("div"); > new Ext.dom.Element("div"); And don't forget: document.createElement("div"); (Wait, what just happened?!)