W3C home > Mailing lists > Public > www-dom@w3.org > July to September 2011

Re: [DOM4]: Element.create

From: James Graham <jgraham@opera.com>
Date: Fri, 16 Sep 2011 10:31:48 +0200
Message-ID: <4E730974.4000307@opera.com>
To: www-dom@w3.org
On 09/15/2011 08:17 PM, Anne van Kesteren wrote:
> On Thu, 15 Sep 2011 20:07:51 +0200, Charles Pritchard <chuck@jumis.com>
> wrote:
>> On webapps, we discussed a helper method, "create", which might fit
>> well in DOM4.
>> http://lists.w3.org/Archives/Public/public-webapps/2011JulSep/0707.html
>>
>> Element.create('img', {src: '...'}),
>

> It's also unclear to me whether the second argument should set
> properties or attributes. Setting attributes would be consistent with
> the DOM model. Setting properties might be more convenient, but e.g.
> setting innerHTML complicates matters as there is also a third argument
> to Element.create to conveniently set children.

I think we should just set (content) attributes; it makes for a very 
straightforward, easily understood, API.
Received on Friday, 16 September 2011 08:32:24 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:14:08 GMT