let elem = document.getElementById("the tag you want to change code of"); elem.innerHTML = "<p>Hello</p>"; document.innerHTML += '<a href="youtue.com">click me !</a>';