好了,哈哈哈
function createa(url,text)
{
var a=document.createElement("a");
a.href = url;
a.innerHTML=text;
a.setAttribute("style", "text-decoration:none;");
a.style.color="red";
body.appendChild(a);
}
// 调用函数创建链接
createa("https://www.imooc.com/","慕课网");