用setAttribute来设置文字颜色不用 a.style.color,如何写,
function createa(url,text)
{
var a=document.createElement("a");
a.setAttribute("href",url);
a.innerHTML=text;
a.style.color="red";
main.appendChild(a);
}
function createa(url,text)
{
var a=document.createElement("a");
a.setAttribute("href",url);
a.innerHTML=text;
a.style.color="red";
main.appendChild(a);
}
2017-06-06
举报