title: Most efficient way to create and nest divs with appendChild using *plain* javascript (no libraries)
body: <p>Is there a more efficient way to write the following appendChild / nesting code?</p>
  
  <pre><code>var sasDom, sasDomHider;
  var d = document;
  var docBody = d.getElementsByTagName("body")[0];
  var newNode = d.createElement('span');
  var secondNode = d.createElement('span');
  
  // Hider dom
  newNode.setAttribute("id", "sasHider");
  docBody.appendChild(newNode);
  sasDomHider = d.getElementById("sasHider");
  
  // Copyier dom
  secondNode.setAttribute("id", "sasText");
  sasDomHider.appendChild(secondNode);
  sasDom = d.getElementById("sasText");
  </code></pre>