document.querySelectorAll('.ms-gb > a').forEach(function(item){ item.textContent = item.nextSibling.nodeValue.trim() console.log(item.textContent) });