var x = document.createElement('div'); x.innerHTML = HM[id]; document.getElementById('shher').innerHTML = x.getElementsByTagName('name')[0].innerHTML;