3
Error is very simple but can not find.
I am learning to use the DOM CORE API.
I created a DIV, and inside I put an UL.
I’m warning you who the DIV’s first child is, and the results are coming in OBJECT TEXT
. instead of giving OBJECT UL LIST
.
follows the code.
<html lang="pt-BR">
<head>
<title>Dom Core Api</title>
<meta charset="utf-8">
<script src="js/testDom.js"></script>
</head>
<body>
<div>
<ul><li>Rodrigo</li>
<li>Robson</li>
</ul>
</div>
</body>
</html>
Code Avascript
window.onload = function() {
var div = document.getElementsByTagName("div").item(0);
alert(div.firstChild);
}
the post was adjusted
– Rodrigo Jacinto
Improved quite adjusted.
– Bacco