JS DOM: 31. Node type
by istiq20
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Node Type</title>
</head>
<body>
Eko Kurniawan Khannedy
<!--Ini Komentar-->
<h1>Ini Title</h1>
<script>
const nodes = document.body.childNodes;
for (let node of nodes) {
console.info(`${node} : ${node.nodeType}`);
}
</script>
</body>
</html>