為啥我的什么都沒有顯示
<!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 newnode = document.createElement("a");
? ? newnode.setAttribute("href","url");
? ? newnode.setAttribute("innerHTML","text");
? ? main.appendChild(newnode);
? ??
}
// 調(diào)用函數(shù)創(chuàng)建鏈接
createa("www.baidu.com","百度");
</script>?
</body>
</html>
2018-12-20