To do it without using a JavaScript library such as jQuery, you'd do it like this:
var span = document.getElementById("myspan"),
text = document.createTextNode(''+intValue);
span.innerHTML = ''; // clear existing
span.appendChild(text);
If you do want to use jQuery, it's just this:
$("#myspan").text(''+intValue);