求大神告知,哪里出了问题?一直找不出来
var main = document.body;
创建链接
function createa(url,text)
{
var a=document.createElement("a");
a.setAttribute(href,"url");
a.innerHTML=text;
a.setAttribute(style,"red");
main.appendChild(a);
}
createa(" http://www.imooc.com","慕课网");// 调用函数创建链接