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