ในการกำหนดจำนวนโหนดในรายการโหนด ให้ใช้ความยาว ทรัพย์สิน
ตัวอย่าง
คุณสามารถลองเรียกใช้โค้ดต่อไปนี้เพื่อเรียนรู้วิธีใช้ ความยาว คุณสมบัติใน JavaScript -
<!DOCTYPE html>
<html>
<body>
<p>Demo Text1</p>
<p id = "pid"></p>
<script>
var myLen = document.querySelectorAll("p");
document.getElementById("pid").innerHTML = "This document has " + myLen.length + " paragraph tags.";
</script>
</body>
</html>