var sp = document.getElementsByTagName('span'); document.body.removeChild(sp[1]); alert(sp[0].innerHTML)