Re: Element.createElement proposal
Mike Shaver <[email protected]>
| Newsgroups | gmane.comp.mozilla.devel.dom |
|---|---|
| Message-ID | <[email protected]> |
On Wed, Oct 28, 2009 at 6:39 AM, Ted Mielczarek <[email protected]> wrote: > On Tue, Oct 27, 2009 at 6:44 PM, Robert O'Callahan <[email protected]>wrote: > >> Instead of using a JS object, it's probably more performant, and I think >> slightly more convenient, to just specify extra arguments: >> e.addChild("span", "class", "hello", "style", "width:100px"); >> You can write it as >> e.addChild("span", >> "class", "hello", >> "style", "width:100px"); >> if you like. >> > > That strikes me as less intuitive, and it also doesn't match what existing > JS libraries like jQuery provide: > http://docs.jquery.com/Attributes/attr#properties > http://docs.jquery.com/CSS/css#properties I agree -- having to count out the strings to build the pairings of attribute and value seems error-prone, and it's pretty hard to build the parameters for such a call programmatically. Mike