var span = document.getElementById("customSpan"); span.textContent = "some text";
var span = document.getElementById("span"); var a = document.createElement('a'); a.href = "http://domain.com"; span.appendChild(a);