title: JSON to setAttribute()
body: <p>I've almost got the following working, but have run across many confusing approaches. The desire is using the key:value in the attr{} for the setAttribute() method properties, WITHOUT a framework.</p>
  
  <p>Please lend a slim solution:</p>
  
  <pre><code>testDiv = document.getElementById("testDiv");
  
  
  attr = {
  
      align:"center",
      title:"The Test Div"
  
  };
  
  //Possible converting JSON to String, the use in setAttribute?
  
  for(var x in attr) alert(x + " , " + attr[ x ] );
  
  testDiv.setAttribute( x ,  attr[ x ]);
  </code></pre>