Using createAttribute vs. just setting the attribute directly?
<p>In javascript, we can create a new DOM element in the following ways...</p>

<p>By using the createAttribute() + setAttributeNode() dom methods:</p>

<pre><code>var input = document.createElement("input"),
    type = document.createAttribute("type");

type.nodeValue = "text";
input.setAttributeNode(type);
container.appendChild(input);
</code></pre>

<p>or by just setting the attributes directly:</p>

<pre><code>var input = document.createElement("input");

input.type = "text";
container.appendChild(input);
</code></pre>

<p>The latter can end up being quite lot less code, even when there are only a couple attributes per element.  </p>

<p><em>The question</em>: has anyone run across any drawbacks of the latter method (setting attributes directly)?</p>

<p>I tested this on several browsers (the latest FF, IE, Safari, Opera, old IEs - even IE6 worked) and on a basic test (inserting a text input with type, name, and maxLength attributes) they all passed.  <a href="http://jsfiddle.net/DonamiteIsTNT/GG7tF/6/embedded/result/" rel="nofollow">Here's the fiddle</a> if anybody needs it.</p>
