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/","慕课网");
function createa(url,text) { var a = document.createElement("a"); a.href = url; a.innerHTML = text; a.style.color = "red"; main.appendChild(a); }// 调用函数创建链接 createa("http://www.imooc.com/","慕课网");
调试都没调试 就发出来了?