You can use the replace()
. More info here
I'm not very good at RegExp, so I can't tell you exactly what to write, but something along the lines of:
var divHTML = getElementById("myDiv"); //The div which contains your spans
divHTML.innerHTML.replace(/<span>/gi, "<label>");
divHTML.innerHTML.replace(/<\/span>/gi, "</label>");
Please don't bust me on this, though :p
edit: If you want to maintain class names, ids and such, you simply leave out the right-angle-bracket:
divHTML.innerHTML.replace(/<span/gi, "<label");
This will turn <span id="mySpan" class="spans">
into <label id="mySpan" class="spans">