慕仰5364098
2019-04-26 21:24
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/","慕课网");
调试都没调试 就发出来了?
JavaScript进阶篇
469062 学习 · 22582 问题
相似问题