📅  最后修改于: 2022-03-11 15:01:38.542000             🧑  作者: Mango
//for adding a link through JavaScript
let anchor=document.createElement("a");
anchor.href="_anylinkthatyouwanttoadd_";
anchor.innerText="Go to the above link";//optional
console.log(anchor)
let to_add=document.getElementById("the-id-of-the-element-where-you-want-to-add")
to_add.appendChild(anchor)