constructing dynamic divs in jquery and javascript
<p>Hmmm
All the answers I've seen here suggest that this should work, but...</p>

<p>Is...</p>

<pre><code>    var qnDivName = "qnDiv" + i;
    var currentQnDiv = document.createElement("div");
    var qnDivId = document.createAttribute("id");
    qnDivId.nodeValue = qnDivName;
    currentQnDiv.setAttributeNode(qnDivId);
    currentQnDiv.className = "questionContainer";
</code></pre>

<p>equivalent to...</p>

<pre><code>    var currentQnDiv = $("&lt;div/&gt;", {
        "class": "questionContainer",
        id: "qnDiv" + i
    });
    alert("qndiv class: " + currentQnDiv.className);
</code></pre>

<p>?</p>

<p>The alert gives 'undefined'.
The 'i' is from a for loop. I'm dynamically creating divs to attach to a document further down the page...</p>

<pre><code>    testDiv.appendChild(currentQnDiv);      
  } //end for loop
</code></pre>

<p>the ordinary js works, but the jQuery doesn't. I have other jQuery that works in a calling function, so...</p>

<p>Any ideas?</p>
