JavaScript function to change an element tag
You will have a css concatenation issue if the passed element already has a class, for example : 

&lt;div class="test" id="one"&gt;&lt;/div&gt;


will turn into : 

&lt;div class="testdivilize-span" id="one"&gt;&lt;/div&gt;


Then on the actual efficiency of the function, I would use standard calls and quicker logic to speed things up : 

function divilize(elm) {

   var clone = elm.cloneNode(true);
   var tagName = clone.tagName.toLowerCase(); 

   clone.className += " divilize-"+tagName; 
   elm.outerHTML = clone.outerHTML.replace(tagName, "div");   

}  


@ Fiddle