【发布时间】:2020-10-04 21:33:06
【问题描述】:
我从中得到的输出是suscribe herenoobie。我正在尝试在 h1
let myElement = document.createElement("h1");
let myAttribute = document.createElement("a");
myAttribute.innerText = "noobie";
myElement.innerText = `suscribe ${myAttribute} here`;
myAttribute.classList.add("decoration");
myAttribute.setAttribute("href", "www.peo.com");
myElement.appendChild(myAttribute);
document.body.appendChild(myElement);
【问题讨论】:
标签: javascript html