const link = document.querySelector('a'); console.log(link.getAttribute('href')); link.setAttribute('href', 'https://www.yahoo.com'); link.innerText='Yahoo';