為什么沒有輸出呢
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>無標題文檔</title>
</head>
<body>
?<div>
? ? ?<p>javascript</p>
? ? ?<div>jQuery</div>
? ? ?<h5>PHP</h5>
</div>
<script type="text/javascript">
? var x=document.getElementByTagName("div")[0];
? ? document.write(x.firstChild);
? ? document.write(x.lastChild);
</script>
</body>
</html>
2020-02-14
getElementsByTagName? 你打錯了?
2020-03-06
給的題目是:
var?x?=?document.getElementById("con");
document.write(x.firstChild);? =>
document.write(x.firstChild.nodeName?+?"<br?/>");
就像:只寫到了“孩子”,你輸出肯定不出,你得輸出“孩子名”,就這樣吧 我理解的
2020-02-26
我尋思自己造的方法也沒法用啊?
2020-02-14
<script>第二行代碼,是getElementsByTagName,不是getElementByName