Haschildnodes() does not work
<p>I have a tree view and a delete button on the webpage. The tree view loads with parent nodes and child nodes. If I click on delete after selecting a parent node with child nodes, it should give me a message provided below accordingly with a confirmation box.</p>

<p>Right now, when I select a parent node without any child nodes it gives me the following message: ""The element has at least one child.".
When it should be giving me this message: "The element has no children."</p>

<p>Code:</p>

<pre><code>function check() {
    var treeViewData = window["&lt;%=nav_tree_items.ClientID%&gt;" + "_Data"];
    var selectedNode = document.getElementById(treeViewData.selectedNodeID.value);

    var hasChilds = selectedNode.hasChildNodes();

    if (hasChilds) {
        alert("The element has at least one child.");
    } else {
        alert("The element has no children.");
    }
</code></pre>

<p>Please help.
Thank you and sorry if I may have caused confusion in my explanation </p>
