title: How to change a HTML tag using JavaScript
body: <p>Consider the following code:</p>
  
  <pre><code>var element = document.CreateElement("div");
  element.toString(); // [object HTMLDivElement]
  
  var element = document.CreateElement("somerandomtag");
  element.toString(); // [object HTMLUnknownElement]
  </code></pre>
  
  <p>My gut instinct is that once an element has been created, it is essentially "strongly typed" (if such a thing exists in JavaScript), because "div" creates a <code>HTMLDivElement</code> and "somerandomtag" creates a <code>HTMLUnknownElement</code>, thus, the tag cannot be changed, because the created object corresponds directly to that tag.</p>
  
  <p>Consider the following code:</p>
  
  <pre><code>var element = document.CreateElement("div");
  element.toString(); // [object HTMLDivElement]
  
  element.nodeName = "span"; // Doesn't work.
  element.tagName = "span"; // Doesn't work.
  </code></pre>
  
  <p>So, is it possible to change an element from one type (e.g. "div") to another type (e.g. "span") beyond the object's creation?</p>
  
  <p><strong>EDIT:</strong> Please note...MUST be done with pure javascript...NO jQuery or other libraries/apis</p>