hi all!!! I have a question relative to DOM in this code:
The output of this code yields “Length of the list=3”, that is, the number of children of the element dl is three but he number of items in the list is only one!! Why??Code:<html> <head> <script type="text/javascript"> function myFunction() { alert("Length of the list="+document.getElementById("users_list").childNodes.length); }; </script> </head> <body> <dl id="users_list"> <dt onclick="myFunction()"> This is the first Item </dt> </dl> </body> </html>
Thank you very much!!


Reply With Quote
Bookmarks