我想去掉a標(biāo)簽的下劃線,代碼如何實(shí)現(xiàn)
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>無標(biāo)題文檔</title>
</head>
<body>
<script type="text/javascript">
var main = document.body;
//創(chuàng)建鏈接
function createa(url,text)
{
? ? var a=document.createElement("a");
? ? a.href=url;
? ? a.innerHTML=text;
? ? a.style.color="red";
? ? a.style.text-decoration="none";
? ? main.appendChild(a);
}
// 調(diào)用函數(shù)創(chuàng)建鏈接
? ? createa("http://idcbgp.cn","慕課網(wǎng)");
// 調(diào)用函數(shù)創(chuàng)建鏈接
</script>?
</body>
</html>
2017-05-27
s樓上的寫的沒錯,只是語法用的css里面的,代碼如下:a.style.textDecoration="none";
2017-05-18
a.style.text-decoration="none";