title: javascript document.createElement function?
body: <p>I have a variable which contains 3 tag names which are separated from each other by a "," character. I want to split them appart with .split() function and then create and append 3 elements to the document body.</p>
  
  <pre><code>&lt;head&gt;
  &lt;style&gt;
  div { height:500px; width:500px; background:#F00; float:left}   
  span{display:block; float:right}   
  &lt;/style&gt;
  
  &lt;script type="text/javascript"&gt;
  
  var element= div,p,span;    
  var j=element.split(',')
  
  for(i=0;i&lt;j.length;i++){            
      var crt=document.createElement(j[i])
  }
  
  document.body.append(crt)
  
  &lt;/script&gt;    
  &lt;/head&gt;    
  &lt;body&gt;
  &lt;/body&gt;
  </code></pre>