RE: Convenient way to create element and set its attributes at once

From: Rick Waldron [mailto:waldron.rick@gmail.com] 

> 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?!)

Received on Tuesday, 3 December 2013 02:08:52 UTC